6 #include <QColorDialog>
8 #include <QFontComboBox>
10 #include <QStyleFactory>
12 #include "ui_settingsguicomponent.h"
19 using namespace swift::gui::settings;
20 using namespace swift::core::context;
28 ui->cb_SettingsGuiWidgetStyle->clear();
36 ui->comp_SettingsFonts->setStyleSheetDefaultColor();
40 &CSettingsGuiComponent::selectionChanged);
43 this->guiSettingsChanged();
50 ui->hs_SettingsGuiOpacity->setVisible(!
hide);
51 ui->lbl_SettingsGuiOpacity->setVisible(!
hide);
56 ui->hs_SettingsGuiOpacity->setValue(
static_cast<int>(value));
59 void CSettingsGuiComponent::selectionChanged()
64 if (sm == m_guiSettings.get().getPreferredSelection()) {
return; }
66 m_guiSettings.setAndSaveProperty(CGeneralGuiSettings::IndexPreferredSelection, CVariant::fromValue(sm));
67 CLogMessage::preformatted(m);
70 void CSettingsGuiComponent::guiSettingsChanged()
73 const int index = ui->cb_SettingsGuiWidgetStyle->findText(settings.getWidgetStyle());
74 if (index != ui->cb_SettingsGuiWidgetStyle->currentIndex())
76 ui->cb_SettingsGuiWidgetStyle->setCurrentIndex(index);
79 switch (settings.getPreferredSelection())
87 void CSettingsGuiComponent::widgetStyleChanged(
int index)
89 const QString widgetStyle = ui->cb_SettingsGuiWidgetStyle->itemText(index);
101 tr(
"Changing style requires a restart.\nChanges will be visible a the "
102 "next start.\nDo you want to save your changes?"),
107 ui->cb_SettingsGuiWidgetStyle->setCurrentText(settings.
getWidgetStyle());
115 ui->cb_SettingsGuiWidgetStyle->setCurrentText(settings.
getWidgetStyle());
118 const CStatusMessage m = m_guiSettings.setAndSaveProperty(CGeneralGuiSettings::IndexWidgetStyle, widgetStyle);
119 CLogMessage::preformatted(m);
const context::IContextNetwork * getIContextNetwork() const
Direct access to contexts if a CCoreFacade has been initialized.
virtual bool isConnected() const =0
Network connected?
void changedWindowsOpacity(int opacity)
Change the windows opacity 0..100.
void setGuiOpacity(double value)
GUI Opacity 0-100%.
virtual ~CSettingsGuiComponent()
Destructor.
void hideOpacity(bool hide)
Hide opacity elements.
bool isDifferentValidWidgetStyle(const QString &style) const
Has changed widget style.
const QString & getWidgetStyle() const
Widget style.
Class for emitting a log message.
Derived & validationError(const char16_t(&format)[N])
Set the severity to error, providing a format string, and adding the validation category.
Streamable status message, e.g.
SWIFT_GUI_EXPORT swift::gui::CGuiApplication * sGui
Single instance of GUI application object.
High level reusable GUI components.
Free functions in swift::misc.
void valueChanged(int value)
void currentIndexChanged(int index)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QString tr(const char *sourceText, const char *disambiguation, int n)