Skip to content

Commit 2a830e5

Browse files
committed
Update QDarkStyleSheet to v3.0.rc and add new light style
Thanks to a new light style provided by QDarkStyleSheet in v3.0.rc (9eea545) we can add a new light style option. `qdarkstyle/dark/style.qrc` had to be renamed to `qdarkstyle/dark/darkstyle.qrc` and `qdarkstyle/light/style.qrc` to `qdarkstyle/light/lightstyle.qrc` in order to include both as resources. See issues: - ColinDuquesnoy/QDarkStyleSheet#240 - ColinDuquesnoy/QDarkStyleSheet#273 - #2558
1 parent c5199f5 commit 2a830e5

File tree

658 files changed

+5713
-725
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

658 files changed

+5713
-725
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,8 @@ set(SQLB_RESOURCES
274274
src/translations/flags/flags.qrc
275275
src/translations/translations.qrc
276276
src/certs/CaCerts.qrc
277-
src/qdarkstyle/style.qrc
277+
src/qdarkstyle/dark/darkstyle.qrc
278+
src/qdarkstyle/light/lightstyle.qrc
278279
)
279280

280281
set(SQLB_MISC

src/ExtendedScintilla.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ void ExtendedScintilla::reloadCommonSettings()
145145
setMarginsBackgroundColor(QColor(0x32, 0x41, 0x4B));
146146
setMarginsForegroundColor(QColor(0xEF, 0xF0, 0xF1));
147147
break;
148+
case Settings::LightStyle :
149+
setMarginsBackgroundColor(QColor("#C9CDD0"));
150+
setMarginsForegroundColor(QColor("#000000"));
151+
break;
148152
}
149153
setPaper(Settings::getValue("syntaxhighlighter", "background_colour").toString());
150154
setColor(Settings::getValue("syntaxhighlighter", "foreground_colour").toString());

src/MainWindow.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2287,13 +2287,16 @@ void MainWindow::reloadSettings()
22872287
updateRecentFileActions();
22882288
}
22892289

2290-
switch (static_cast<Settings::AppStyle>(Settings::getValue("General", "appStyle").toInt())) {
2290+
Settings::AppStyle style = static_cast<Settings::AppStyle>(Settings::getValue("General", "appStyle").toInt());
2291+
2292+
switch (style) {
22912293
case Settings::FollowDesktopStyle :
22922294
qApp->setStyleSheet("");
22932295

22942296
break;
22952297
case Settings::DarkStyle :
2296-
QFile f(":qdarkstyle/style.qss");
2298+
case Settings::LightStyle :
2299+
QFile f(style == Settings::DarkStyle ? ":qdarkstyle/dark/style.qss" : ":qdarkstyle/light/style.qss");
22972300
if (!f.exists()) {
22982301
QMessageBox::warning(this, qApp->applicationName(),
22992302
tr("Could not find resource file: %1").arg(f.fileName()));

src/PreferencesDialog.ui

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,11 @@
537537
<string>Dark style</string>
538538
</property>
539539
</item>
540+
<item>
541+
<property name="text">
542+
<string>Light style</string>
543+
</property>
544+
</item>
540545
</widget>
541546
</item>
542547
<item row="2" column="0">

src/Settings.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,16 @@ QColor Settings::getDefaultColorValue(const std::string& group, const std::strin
494494
if(name == "bin_bg_colour")
495495
return QColor(0x19, 0x23, 0x2D);
496496
break;
497+
case LightStyle :
498+
if(name == "null_fg_colour" || name == "bin_fg_colour")
499+
return QColor("#A5A9AC");
500+
if(name == "null_bg_colour" || name == "bin_bg_colour")
501+
return QColor("#FAFAFA");
502+
if(name == "reg_fg_colour")
503+
return QColor("#000000");
504+
if(name == "reg_bg_colour")
505+
return QColor("#FAFAFA");
506+
break;
497507
}
498508
}
499509

@@ -515,6 +525,10 @@ QColor Settings::getDefaultColorValue(const std::string& group, const std::strin
515525
foregroundColour = QColor(0xF0, 0xF0, 0xF0);
516526
backgroundColour = QColor(0x19, 0x23, 0x2D);
517527
break;
528+
case LightStyle :
529+
foregroundColour = QColor("#000000");
530+
backgroundColour = QColor("#FAFAFA");
531+
break;
518532
}
519533
if(name == "foreground_colour")
520534
return foregroundColour;
@@ -536,7 +550,7 @@ QColor Settings::getDefaultColorValue(const std::string& group, const std::strin
536550
else if(name == "comment_colour")
537551
return QColor(Qt::green);
538552
else if(name == "identifier_colour")
539-
return QColor(Qt::magenta);
553+
return QColor(221, 160, 221);
540554
else if(name == "string_colour")
541555
return QColor(Qt::lightGray);
542556
else if(name == "currentline_colour")

src/Settings.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ class Settings
1212
public:
1313
enum AppStyle {
1414
FollowDesktopStyle,
15-
DarkStyle
15+
DarkStyle,
16+
LightStyle
1617
};
1718

1819
static void setUserSettingsFile(const QString& userSettingsFileArg);

src/qdarkstyle/LICENSE.md

Lines changed: 0 additions & 185 deletions
This file was deleted.

0 commit comments

Comments
 (0)