fix: make QLineEdit's less ugly in light themes (#6055)

This commit is contained in:
pajlada
2025-03-09 17:10:49 +01:00
committed by GitHub
parent 6b80321083
commit 037196ec3b
6 changed files with 36 additions and 10 deletions
+13
View File
@@ -16,6 +16,7 @@
#include "providers/twitch/TwitchChannel.hpp"
#include "singletons/Emotes.hpp"
#include "singletons/Settings.hpp"
#include "singletons/Theme.hpp"
#include "singletons/WindowManager.hpp"
#include "util/Helpers.hpp"
#include "widgets/helper/ChannelView.hpp"
@@ -315,6 +316,8 @@ EmotePopup::EmotePopup(QWidget *parent)
}
this->reloadEmotes();
});
this->themeChangedEvent();
}
void EmotePopup::addShortcuts()
@@ -660,6 +663,16 @@ void EmotePopup::moveEvent(QMoveEvent *event)
BasePopup::moveEvent(event);
}
void EmotePopup::themeChangedEvent()
{
BasePopup::themeChangedEvent();
// NOTE: This currently overrides the QLineEdit's font size.
// If the dialog is open when the theme is changed, things will look a bit off.
// This can be alleviated by us using a single application-wide style sheet for these things.
this->search_->setStyleSheet(this->theme->splits.input.styleSheet);
}
void EmotePopup::closeEvent(QCloseEvent *event)
{
this->saveBounds();
+1
View File
@@ -28,6 +28,7 @@ public:
protected:
void resizeEvent(QResizeEvent *event) override;
void moveEvent(QMoveEvent *event) override;
void themeChangedEvent() override;
private:
ChannelView *globalEmotesView_{};
+7 -10
View File
@@ -191,6 +191,8 @@ SelectChannelDialog::SelectChannelDialog(QWidget *parent)
this->ui_.twitch.channel->setFocus();
this->addShortcuts();
this->themeChangedEvent();
}
void SelectChannelDialog::ok()
@@ -392,16 +394,11 @@ void SelectChannelDialog::themeChangedEvent()
{
BaseWindow::themeChangedEvent();
if (this->theme->isLightTheme())
{
this->setStyleSheet(
"QRadioButton { color: #000 } QLabel { color: #000 }");
}
else
{
this->setStyleSheet(
"QRadioButton { color: #fff } QLabel { color: #fff }");
}
// NOTE: This currently overrides the QLineEdit's font size.
// If the dialog is open when the theme is changed, things will look a bit off.
// This can be alleviated by us using a single application-wide style sheet for these things.
this->ui_.twitch.channelName->setStyleSheet(
this->theme->splits.input.styleSheet);
}
void SelectChannelDialog::addShortcuts()