diff --git a/krusader/Konfigurator/kgpanel.cpp b/krusader/Konfigurator/kgpanel.cpp --- a/krusader/Konfigurator/kgpanel.cpp +++ b/krusader/Konfigurator/kgpanel.cpp @@ -381,9 +381,11 @@ auto *hbox = new QHBoxLayout(); auto *fontLayout = new QHBoxLayout(); - fontLayout->addWidget(new QLabel(i18n("View font:"), panelGrp)); + QLabel *labelFontLay = new QLabel(i18n("View font:"), panelGrp); + fontLayout->addWidget(labelFontLay); KonfiguratorFontChooser *chsr = - createFontChooser("Look&Feel", "Filelist Font", _FilelistFont, panelGrp, true, PAGE_VIEW); + createFontChooser("Look&Feel", "Filelist Font", _FilelistFont, + labelFontLay, panelGrp, true, QString(), PAGE_VIEW); fontLayout->addWidget(chsr); fontLayout->addStretch(1); hbox->addLayout(fontLayout, 1); diff --git a/krusader/Konfigurator/kguseractions.cpp b/krusader/Konfigurator/kguseractions.cpp --- a/krusader/Konfigurator/kguseractions.cpp +++ b/krusader/Konfigurator/kguseractions.cpp @@ -79,7 +79,8 @@ QLabel *lbel = new QLabel(i18n("Normal font:"), hboxWidget); hbox->addWidget(lbel); - KonfiguratorFontChooser *chser = createFontChooser("UserActions", "Normal Font", _UserActions_NormalFont, hboxWidget); + KonfiguratorFontChooser *chser = createFontChooser("UserActions", "Normal Font", + _UserActions_NormalFont, lbel, hboxWidget); hbox->addWidget(chser); QWidget *spcer = createSpacer(hboxWidget); @@ -92,7 +93,8 @@ lbel = new QLabel(i18n("Font with fixed width:"), hboxWidget); hbox->addWidget(lbel); - chser = createFontChooser("UserActions", "Fixed Font", _UserActions_FixedFont, hboxWidget); + chser = createFontChooser("UserActions", "Fixed Font", + _UserActions_FixedFont, lbel, hboxWidget); hbox->addWidget(chser); spcer = createSpacer(hboxWidget); diff --git a/krusader/Konfigurator/konfiguratorpage.h b/krusader/Konfigurator/konfiguratorpage.h --- a/krusader/Konfigurator/konfiguratorpage.h +++ b/krusader/Konfigurator/konfiguratorpage.h @@ -233,15 +233,18 @@ * @param configGroup The class name used in KConfig (ex. "Archives") * @param name The item name used in KConfig (ex. "Do Tar") * @param defaultValue The default value of the font chooser + * @param label The label that is associated to the font chooser * @param parent Reference to the parent widget * @param restart The change of this parameter requires Krusader restart * @param page The subpage of a Konfigurator page (because of setDefaults) * * @return reference to the newly created font chooser */ KonfiguratorFontChooser *createFontChooser(QString configGroup, QString name, - const QFont& defaultValue, QWidget *parent = nullptr, - bool restart = false, int page = FIRST_PAGE); + const QFont &defaultValue, QLabel *label, + QWidget *parent = nullptr, bool restart = false, + const QString &toolTip = QString(), + int page = FIRST_PAGE); /** * Adds a new combobox item to the page. diff --git a/krusader/Konfigurator/konfiguratorpage.cpp b/krusader/Konfigurator/konfiguratorpage.cpp --- a/krusader/Konfigurator/konfiguratorpage.cpp +++ b/krusader/Konfigurator/konfiguratorpage.cpp @@ -255,10 +255,17 @@ } KonfiguratorFontChooser *KonfiguratorPage::createFontChooser(QString configGroup, QString name, - const QFont& defaultValue, QWidget *parent, bool restart, int page) + const QFont &defaultValue, QLabel *label, QWidget *parent, bool restart, + const QString &toolTip, int page) { KonfiguratorFontChooser *fontChooser = new KonfiguratorFontChooser(std::move(configGroup), std::move(name), defaultValue, parent, restart, page); + if (!toolTip.isEmpty()) { + label->setWhatsThis(toolTip); + label->setToolTip(toolTip); + fontChooser->setWhatsThis(toolTip); + fontChooser->setToolTip(toolTip); + } registerObject(fontChooser->extension()); return fontChooser;