Skip to content

Commit

Permalink
Revert "Dim disabled items in context menus (#4423)"
Browse files Browse the repository at this point in the history
This reverts commit 6427184.
  • Loading branch information
pajlada committed May 2, 2023
1 parent 6672adf commit 30530b6
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 40 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
- Bugfix: Fixed emote & badge tooltips not showing up when thumbnails were hidden. (#4509)
- Bugfix: Fixed links with invalid IPv4 addresses being parsed. (#4576)
- Bugfix: Fixed the macOS icon changing to the wrong icon when the application is open. (#4577)
- Bugfix: Fixed disabled items in context-menus having a weird text-effect or the default text color. (#4423)
- Dev: Disabling precompiled headers on Windows is now tested in CI. (#4472)
- Dev: Themes are now stored as JSON files in `resources/themes`. (#4471, #4533)
- Dev: Ignore unhandled BTTV user-events. (#4438)
Expand Down
11 changes: 0 additions & 11 deletions resources/qss/settings.qss
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,3 @@ chatterino--NavigationLabel {
font-size: 15px;
color: #A6DDF4;
}

QMenu {
background: #242424;
border: #555555;
color: #ffffff;
selection-background-color: #555555;
}

QMenu::item:disabled {
color: #8c7f7f;
}
8 changes: 0 additions & 8 deletions src/singletons/Theme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,6 @@ void Theme::parseFrom(const QJsonObject &root)
(this->isLightTheme() ? "#68B1FF"
: this->tabs.selected.backgrounds.regular.name());

this->window.contextMenuStyleSheet =
QStringLiteral("QMenu { background: %1; border: %2; color: %3; "
"selection-background-color: %2; } "
"QMenu::item:disabled { color: #8c7f7f; }")
.arg(splits.input.background.name(QColor::HexArgb),
tabs.selected.backgrounds.regular.name(QColor::HexArgb),
tabs.selected.text.name(QColor::HexArgb));

// Usercard buttons
if (this->isLightTheme())
{
Expand Down
2 changes: 0 additions & 2 deletions src/singletons/Theme.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ class Theme final : public Singleton
struct {
QColor background;
QColor text;

QString contextMenuStyleSheet;
} window;

/// TABS
Expand Down
5 changes: 0 additions & 5 deletions src/widgets/BaseWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,6 @@ bool BaseWindow::supportsCustomWindowFrame()

void BaseWindow::themeChangedEvent()
{
if (!this->flags_.has(BaseWindow::DisableStyleSheet))
{
this->setStyleSheet(this->theme->window.contextMenuStyleSheet);
}

if (this->hasCustomWindowFrame())
{
QPalette palette;
Expand Down
17 changes: 8 additions & 9 deletions src/widgets/BaseWindow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,16 @@ class BaseWindow : public BaseWidget
Q_OBJECT

public:
enum Flags : uint32_t {
enum Flags {
None = 0,
EnableCustomFrame = 1,
Frameless = (1 << 1),
TopMost = (1 << 2),
DisableCustomScaling = (1 << 3),
FramelessDraggable = (1 << 4),
DontFocus = (1 << 5),
Dialog = (1 << 6),
DisableLayoutSave = (1 << 7),
DisableStyleSheet = (1 << 8),
Frameless = 2,
TopMost = 4,
DisableCustomScaling = 8,
FramelessDraggable = 16,
DontFocus = 32,
Dialog = 64,
DisableLayoutSave = 128,
};

enum ActionOnFocusLoss { Nothing, Delete, Close, Hide };
Expand Down
7 changes: 3 additions & 4 deletions src/widgets/dialogs/SettingsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@
namespace chatterino {

SettingsDialog::SettingsDialog(QWidget *parent)
: BaseWindow(
{BaseWindow::Flags::DisableCustomScaling, BaseWindow::Flags::Dialog,
BaseWindow::DisableLayoutSave, BaseWindow::DisableStyleSheet},
parent)
: BaseWindow({BaseWindow::Flags::DisableCustomScaling,
BaseWindow::Flags::Dialog, BaseWindow::DisableLayoutSave},
parent)
{
this->setObjectName("SettingsDialog");
this->setWindowTitle("Chatterino Settings");
Expand Down

0 comments on commit 30530b6

Please sign in to comment.