From eb298d4e4fba7e84620ec81f93d809c88d67f69f Mon Sep 17 00:00:00 2001 From: Martchus Date: Tue, 3 Oct 2017 16:58:50 +0200 Subject: [PATCH] plasmoid: Improve note about instance specific settings --- plasmoid/lib/appearanceoptionpage.ui | 14 -------- plasmoid/lib/settingsdialog.cpp | 32 ++++++++++++++--- plasmoid/lib/settingsdialog.h | 1 + .../translations/syncthingplasmoid_de_DE.ts | 35 ++++++++++--------- .../translations/syncthingplasmoid_en_US.ts | 35 ++++++++++--------- 5 files changed, 67 insertions(+), 50 deletions(-) diff --git a/plasmoid/lib/appearanceoptionpage.ui b/plasmoid/lib/appearanceoptionpage.ui index 1dfeadf..268206f 100644 --- a/plasmoid/lib/appearanceoptionpage.ui +++ b/plasmoid/lib/appearanceoptionpage.ui @@ -10,20 +10,6 @@ .. - - - - The following settings are specific to the current instance of the Plasmoid. - - - - - - - Qt::Horizontal - - - diff --git a/plasmoid/lib/settingsdialog.cpp b/plasmoid/lib/settingsdialog.cpp index 57d3387..09e7ff6 100644 --- a/plasmoid/lib/settingsdialog.cpp +++ b/plasmoid/lib/settingsdialog.cpp @@ -22,6 +22,21 @@ using namespace QtGui; namespace Plasmoid { +void addPlasmoidSpecificNote(QLayout *layout, QWidget *parent) +{ + auto *const infoLabel = new QLabel( + QCoreApplication::translate("Plasmoid::Settings", "The settings on this page are specific to the current instance of the Plasmoid."), parent); + infoLabel->setWordWrap(true); + QFont infoFont(infoLabel->font()); + infoFont.setBold(true); + infoLabel->setFont(infoFont); + auto *const line = new QFrame(parent); + line->setFrameShape(QFrame::HLine); + line->setFrameShadow(QFrame::Sunken); + layout->addWidget(line); + layout->addWidget(infoLabel); +} + // ShortcutOptionPage ShortcutOptionPage::ShortcutOptionPage(SyncthingApplet &applet, QWidget *parentWidget) : ShortcutOptionPageBase(parentWidget) @@ -46,15 +61,17 @@ void ShortcutOptionPage::reset() QWidget *ShortcutOptionPage::setupWidget() { - QWidget *widget = new QWidget(); + auto *const widget = new QWidget(); widget->setWindowTitle(QCoreApplication::translate("Plasmoid::ShortcutOptionPage", "Shortcuts")); widget->setWindowIcon(QIcon::fromTheme(QStringLiteral("configure-shortcuts"))); - QVBoxLayout *mainLayout = new QVBoxLayout(widget); - QFormLayout *formLayout = new QFormLayout(widget); + widget->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + auto *const mainLayout = new QVBoxLayout(widget); + auto *const formLayout = new QFormLayout; formLayout->addRow( QCoreApplication::translate("Plasmoid::ShortcutOptionPage", "Global shortcut"), m_globalShortcutEdit = new QKeySequenceEdit(widget)); mainLayout->addLayout(formLayout); - widget->setLayout(mainLayout); + mainLayout->addStretch(1); + addPlasmoidSpecificNote(mainLayout, widget); return widget; } @@ -86,6 +103,13 @@ void AppearanceOptionPage::reset() ui()->brightTextColorsCheckBox->setChecked(config.readEntry("brightColors", false)); } +QWidget *AppearanceOptionPage::setupWidget() +{ + auto *const widget = AppearanceOptionPageBase::setupWidget(); + addPlasmoidSpecificNote(ui()->verticalLayout, widget); + return widget; +} + QtGui::SettingsDialog *setupSettingsDialog(SyncthingApplet &applet) { // setup categories diff --git a/plasmoid/lib/settingsdialog.h b/plasmoid/lib/settingsdialog.h index ad7aae6..b47609c 100644 --- a/plasmoid/lib/settingsdialog.h +++ b/plasmoid/lib/settingsdialog.h @@ -27,6 +27,7 @@ public: AppearanceOptionPage(SyncthingApplet &applet, QWidget *parentWidget = nullptr); private: +DECLARE_SETUP_WIDGETS SyncthingApplet *m_applet; END_DECLARE_OPTION_PAGE diff --git a/plasmoid/translations/syncthingplasmoid_de_DE.ts b/plasmoid/translations/syncthingplasmoid_de_DE.ts index 8377385..d9212f4 100644 --- a/plasmoid/translations/syncthingplasmoid_de_DE.ts +++ b/plasmoid/translations/syncthingplasmoid_de_DE.ts @@ -135,55 +135,58 @@ Erscheinungsbild - - The following settings are specific to the current instance of the Plasmoid. - Die folgenden Einstellungen sind spezifisch für die aktuelle Instanz des Plasmoids. - - - + Size of full representation Minimale Größe - + x - + grid units Rastereinheiten - + Note that the size is ignored when the Plasmoid is displayed on the desktop, in full screen mode or as entry of the system tray Plasmoid. Die eingestellte Größe wird ignoriert, wenn das Plasmoid am Desktop, im Vollbild oder innerhalb des Systemtray-Plasmoids dargestellt wird. - + Colors Farben - + Bright custom text colors (use for dark color scheme) Helle benutzerdefinierte Schriftfarben (für dunkles Farbschema gedacht) + + Plasmoid::Settings + + + The settings on this page are specific to the current instance of the Plasmoid. + Die Einstellungen auf dieser Seite sind spezifisch für die aktuelle Instanz des Plasmoids. + + Plasmoid::SettingsDialog - + Plasmoid - + Web view Weboberfläche - + Extras @@ -191,12 +194,12 @@ Plasmoid::ShortcutOptionPage - + Shortcuts Kurzbefehle - + Global shortcut Globales Tastenkürzel diff --git a/plasmoid/translations/syncthingplasmoid_en_US.ts b/plasmoid/translations/syncthingplasmoid_en_US.ts index e09dbd4..3582724 100644 --- a/plasmoid/translations/syncthingplasmoid_en_US.ts +++ b/plasmoid/translations/syncthingplasmoid_en_US.ts @@ -135,55 +135,58 @@ - - The following settings are specific to the current instance of the Plasmoid. - - - - + Size of full representation - + x - + grid units - + Note that the size is ignored when the Plasmoid is displayed on the desktop, in full screen mode or as entry of the system tray Plasmoid. - + Colors - + Bright custom text colors (use for dark color scheme) + + Plasmoid::Settings + + + The settings on this page are specific to the current instance of the Plasmoid. + + + Plasmoid::SettingsDialog - + Plasmoid - + Web view - + Extras @@ -191,12 +194,12 @@ Plasmoid::ShortcutOptionPage - + Shortcuts - + Global shortcut