From: Marcus Eggenberger Date: Fri, 21 Mar 2008 16:24:19 +0000 (+0000) Subject: Font of the Inputline is now configurable. Closing BR #121. X-Git-Tag: 0.2.0-alpha4~7 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=100cfa79242249feff3bc3265787b46d2dc621b0 Font of the Inputline is now configurable. Closing BR #121. --- diff --git a/src/qtui/inputwidget.cpp b/src/qtui/inputwidget.cpp index 30530c91..53b64c83 100644 --- a/src/qtui/inputwidget.cpp +++ b/src/qtui/inputwidget.cpp @@ -24,6 +24,7 @@ #include "client.h" #include "networkmodel.h" #include "jumpkeyhandler.h" +#include "qtuisettings.h" InputWidget::InputWidget(QWidget *parent) @@ -38,7 +39,13 @@ InputWidget::InputWidget(QWidget *parent) ui.ownNick->setSizeAdjustPolicy(QComboBox::AdjustToContents); ui.ownNick->installEventFilter(new MouseWheelFilter(this)); - ui.inputEdit->installEventFilter(new JumpKeyHandler(this)); + ui.inputEdit->installEventFilter(new JumpKeyHandler(this)); + + QtUiSettings s; + bool useInputLineFont = s.value("UseInputLineFont", QVariant(false)).toBool(); + if(useInputLineFont) { + ui.inputEdit->setFont(s.value("InputLineFont").value()); + } } InputWidget::~InputWidget() { diff --git a/src/qtui/settingspages/fontssettingspage.cpp b/src/qtui/settingspages/fontssettingspage.cpp index 38c149ce..f8ba23bd 100644 --- a/src/qtui/settingspages/fontssettingspage.cpp +++ b/src/qtui/settingspages/fontssettingspage.cpp @@ -21,6 +21,7 @@ #include "fontssettingspage.h" #include "qtui.h" +#include "qtuisettings.h" #include @@ -31,26 +32,29 @@ FontsSettingsPage::FontsSettingsPage(QWidget *parent) mapper = new QSignalMapper(this); connect(ui.chooseGeneral, SIGNAL(clicked()), mapper, SLOT(map())); connect(ui.chooseTopic, SIGNAL(clicked()), mapper, SLOT(map())); - connect(ui.chooseNickList, SIGNAL(clicked()), mapper, SLOT(map())); connect(ui.chooseBufferView, SIGNAL(clicked()), mapper, SLOT(map())); + connect(ui.chooseNickList, SIGNAL(clicked()), mapper, SLOT(map())); + connect(ui.chooseInputLine, SIGNAL(clicked()), mapper, SLOT(map())); connect(ui.chooseChatMessages, SIGNAL(clicked()), mapper, SLOT(map())); connect(ui.chooseNicks, SIGNAL(clicked()), mapper, SLOT(map())); connect(ui.chooseTimestamp, SIGNAL(clicked()), mapper, SLOT(map())); mapper->setMapping(ui.chooseGeneral, ui.demoGeneral); mapper->setMapping(ui.chooseTopic, ui.demoTopic); - mapper->setMapping(ui.chooseNickList, ui.demoNickList); mapper->setMapping(ui.chooseBufferView, ui.demoBufferView); + mapper->setMapping(ui.chooseNickList, ui.demoNickList); + mapper->setMapping(ui.chooseInputLine, ui.demoInputLine); mapper->setMapping(ui.chooseChatMessages, ui.demoChatMessages); mapper->setMapping(ui.chooseNicks, ui.demoNicks); mapper->setMapping(ui.chooseTimestamp, ui.demoTimestamp); connect(mapper, SIGNAL(mapped(QWidget *)), this, SLOT(chooseFont(QWidget *))); - - connect(ui.customAppFonts, SIGNAL(clicked()), this, SLOT(widgetHasChanged())); + + //connect(ui.customAppFonts, SIGNAL(clicked()), this, SLOT(widgetHasChanged())); connect(ui.checkTopic, SIGNAL(clicked()), this, SLOT(widgetHasChanged())); - connect(ui.checkNickList, SIGNAL(clicked()), this, SLOT(widgetHasChanged())); connect(ui.checkBufferView, SIGNAL(clicked()), this, SLOT(widgetHasChanged())); + connect(ui.checkNickList, SIGNAL(clicked()), this, SLOT(widgetHasChanged())); + connect(ui.checkInputLine, SIGNAL(clicked()), this, SLOT(widgetHasChanged())); connect(ui.checkNicks, SIGNAL(clicked()), this, SLOT(widgetHasChanged())); connect(ui.checkTimestamp, SIGNAL(clicked()), this, SLOT(widgetHasChanged())); @@ -73,6 +77,17 @@ void FontsSettingsPage::load() { } void FontsSettingsPage::load(Settings::Mode mode) { + QtUiSettings s; + bool useInputLineFont = s.value("UseInputLineFont", QVariant(false)).toBool(); + QFont inputLineFont; + if(useInputLineFont) { + ui.checkInputLine->setChecked(true); + inputLineFont = s.value("InputLineFont").value(); + } else { + inputLineFont = qApp->font(); + } + initLabel(ui.demoInputLine, inputLineFont); + QTextCharFormat chatFormat = QtUi::style()->format(UiStyle::None, mode); initLabel(ui.demoChatMessages, chatFormat.font()); QTextCharFormat nicksFormat = QtUi::style()->format(UiStyle::Sender, mode); @@ -96,6 +111,10 @@ void FontsSettingsPage::load(Settings::Mode mode) { } void FontsSettingsPage::save() { + QtUiSettings s; + s.setValue("UseInputLineFont", (ui.checkInputLine->checkState() == Qt::Checked)); + s.setValue("InputLineFont", ui.demoInputLine->font()); + QTextCharFormat chatFormat = QtUi::style()->format(UiStyle::None); chatFormat.setFont(ui.demoChatMessages->font()); QtUi::style()->setFormat(UiStyle::None, chatFormat, Settings::Custom); diff --git a/src/qtui/settingspages/fontssettingspage.ui b/src/qtui/settingspages/fontssettingspage.ui index d76004f7..c261c45a 100644 --- a/src/qtui/settingspages/fontssettingspage.ui +++ b/src/qtui/settingspages/fontssettingspage.ui @@ -5,8 +5,8 @@ 0 0 - 475 - 366 + 588 + 558 @@ -18,13 +18,13 @@ - false + true Custom Application Fonts - true + false false @@ -32,15 +32,11 @@ - - - - General: - - - + + false + 0 @@ -63,6 +59,9 @@ + + false + 0 @@ -76,6 +75,9 @@ + + false + Topic: @@ -83,6 +85,9 @@ + + false + 0 @@ -105,6 +110,9 @@ + + false + 0 @@ -118,16 +126,22 @@ + + false + Buffer Views: - true + false + + false + 0 @@ -150,6 +164,9 @@ + + false + 0 @@ -163,16 +180,22 @@ + + false + Nick List: - true + false + + false + 0 @@ -195,6 +218,51 @@ + + false + + + + 0 + 0 + + + + Choose... + + + + + + + Inputline: + + + + + + + false + + + QFrame::StyledPanel + + + QFrame::Sunken + + + Font + + + Qt::AlignCenter + + + + + + + false + 0 @@ -206,6 +274,16 @@ + + + + false + + + General: + + + @@ -397,12 +475,12 @@ setEnabled(bool) - 46 - 292 + 74 + 349 - 183 - 290 + 310 + 349 @@ -413,12 +491,44 @@ setEnabled(bool) - 96 - 288 + 124 + 349 - 452 - 293 + 559 + 356 + + + + + checkNicks + toggled(bool) + demoNicks + setEnabled(bool) + + + 68 + 317 + + + 338 + 317 + + + + + checkNicks + toggled(bool) + chooseNicks + setEnabled(bool) + + + 117 + 317 + + + 559 + 324 @@ -445,12 +555,12 @@ setEnabled(bool) - 86 - 113 + 114 + 135 - 451 - 118 + 559 + 142 @@ -477,12 +587,12 @@ setEnabled(bool) - 78 - 145 + 106 + 167 - 455 - 151 + 559 + 174 @@ -493,8 +603,8 @@ setEnabled(bool) - 34 - 81 + 62 + 103 190 @@ -509,44 +619,44 @@ setEnabled(bool) - 101 - 81 + 129 + 103 - 451 - 82 + 559 + 110 - checkNicks + checkInputLine toggled(bool) - demoNicks + demoInputLine setEnabled(bool) - 40 - 255 + 82 + 194 - 211 - 257 + 221 + 197 - checkNicks + checkInputLine toggled(bool) - chooseNicks + chooseInputLine setEnabled(bool) - 89 - 257 + 83 + 185 - 447 - 258 + 506 + 194 diff --git a/version.inc b/version.inc index dd60c4a1..278e4bec 100644 --- a/version.inc +++ b/version.inc @@ -4,8 +4,8 @@ { using namespace Global; quasselVersion = "0.2.0-alpha4-pre"; - quasselDate = "2008-03-20"; - quasselBuild = 653; + quasselDate = "2008-03-21"; + quasselBuild = 655; //! Minimum client build number the core needs clientBuildNeeded = 642;