Skip to content

Commit

Permalink
Add QDarkStyle and make styles configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
Setsugennoao committed Apr 5, 2023
1 parent f6e050c commit 610ede6
Show file tree
Hide file tree
Showing 421 changed files with 4,454 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
run: |
mkdir deploy
cp wobbly.exe wibbly.exe deploy
cp -r styles deploy
export PATH=$PATH:vapoursynth/
ldd wobbly.exe | grep -vi '/windows' | grep -v 'VSScript' | awk '{print $3}' | xargs -l1 cp -t deploy
Expand Down
22 changes: 20 additions & 2 deletions src/wobbly/WobblyWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ SOFTWARE.
#define KEY_GEOMETRY QStringLiteral("user_interface/geometry")
#define KEY_FONT_SIZE QStringLiteral("user_interface/font_size")
#define KEY_OVERLAY_SIZE QStringLiteral("user_interface/overlay_size")
#define KEY_APPLICATION_STYLE QStringLiteral("user_interface/application_style")
#define KEY_ASK_FOR_BOOKMARK_DESCRIPTION QStringLiteral("user_interface/ask_for_bookmark_description")
#define KEY_COLORMATRIX QStringLiteral("user_interface/colormatrix")
#define KEY_MAXIMUM_CACHE_SIZE QStringLiteral("user_interface/maximum_cache_size")
Expand Down Expand Up @@ -164,14 +165,14 @@ void WobblyWindow::readSettings() {

overlay_size_spin->setValue(settings.value(KEY_OVERLAY_SIZE, 4).toInt());

application_style_combo->setCurrentText(settings.value(KEY_APPLICATION_STYLE, "Dark").toString());

settings_compact_projects_check->setChecked(settings.value(KEY_COMPACT_PROJECT_FILES, false).toBool());

settings_use_relative_paths_check->setChecked(settings.value(KEY_USE_RELATIVE_PATHS, false).toBool());

settings_bookmark_description_check->setChecked(settings.value(KEY_ASK_FOR_BOOKMARK_DESCRIPTION, true).toBool());

/// Why is it that the default values for some of these settings are kept in this function,
/// but for others they are kept in createSettingsWindow ?
settings_colormatrix_combo->setCurrentText(settings.value(KEY_COLORMATRIX, "BT 601").toString());

settings_cache_spin->setValue(settings.value(KEY_MAXIMUM_CACHE_SIZE, 4096).toInt());
Expand Down Expand Up @@ -2729,6 +2730,10 @@ void WobblyWindow::createSettingsWindow() {
overlay_size_spin = new QSpinBox;
overlay_size_spin->setRange(1, 10);

application_style_combo = new QComboBox;
application_style_combo->addItems({ "Old", "Light", "Dark" });
application_style_combo->setCurrentIndex(0);

settings_colormatrix_combo = new QComboBox;
settings_colormatrix_combo->addItems({
"BT 601",
Expand Down Expand Up @@ -2794,6 +2799,18 @@ void WobblyWindow::createSettingsWindow() {
settings.setValue(KEY_OVERLAY_SIZE, value);
});

connect(application_style_combo, &QComboBox::currentTextChanged, [this] (const QString &text) {
settings.setValue(KEY_APPLICATION_STYLE, text);

if (text == "Old") {
setStyleSheet("");
} else {
QFile styleSheet(QApplication::applicationDirPath() + "/styles/" + text.toLower().toUtf8().constData() + "/style.qss");
if(styleSheet.open(QFile::ReadOnly | QFile::Text))
setStyleSheet(styleSheet.readAll());
}
});

connect(settings_colormatrix_combo, &QComboBox::currentTextChanged, [this] (const QString &text) {
settings.setValue(KEY_COLORMATRIX, text);

Expand Down Expand Up @@ -2924,6 +2941,7 @@ void WobblyWindow::createSettingsWindow() {
form->addRow(settings_bookmark_description_check);
form->addRow(QStringLiteral("Font size"), settings_font_spin);
form->addRow(QStringLiteral("Overlay size"), overlay_size_spin);
form->addRow(QStringLiteral("Application style"), application_style_combo);
form->addRow(QStringLiteral("Colormatrix"), settings_colormatrix_combo);
form->addRow(QStringLiteral("Maximum cache size"), settings_cache_spin);
form->addRow(QStringLiteral("Number of thumbnails"), settings_num_thumbnails_spin);
Expand Down
1 change: 1 addition & 0 deletions src/wobbly/WobblyWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ class WobblyWindow : public QMainWindow {
DockWidget *settings_dock;
QSpinBox *settings_font_spin;
QSpinBox *overlay_size_spin;
QComboBox *application_style_combo;
QCheckBox *settings_compact_projects_check;
QCheckBox *settings_use_relative_paths_check;
QComboBox *settings_colormatrix_combo;
Expand Down
Binary file added styles/dark/rc/arrow_down.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added styles/dark/rc/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added styles/dark/rc/arrow_down_disabled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added styles/dark/rc/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added styles/dark/rc/arrow_down_focus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added styles/dark/rc/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added styles/dark/rc/arrow_down_pressed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added styles/dark/rc/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added styles/dark/rc/arrow_left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added styles/dark/rc/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added styles/dark/rc/arrow_left_disabled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added styles/dark/rc/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added styles/dark/rc/arrow_left_focus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added styles/dark/rc/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added styles/dark/rc/arrow_left_pressed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added styles/dark/rc/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added styles/dark/rc/arrow_right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added styles/dark/rc/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added styles/dark/rc/arrow_right_disabled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added styles/dark/rc/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added styles/dark/rc/arrow_right_focus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added styles/dark/rc/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added styles/dark/rc/arrow_right_pressed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added styles/dark/rc/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added styles/dark/rc/arrow_up.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/arrow_up_disabled.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/arrow_up_focus.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/arrow_up_pressed.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/base_icon.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/base_icon_disabled.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/base_icon_focus.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/base_icon_pressed.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/branch_closed.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/branch_closed_disabled.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/branch_closed_focus.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/branch_closed_pressed.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/branch_end.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/branch_end_disabled.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/branch_end_focus.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/branch_end_pressed.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/branch_line.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/branch_line_disabled.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/branch_line_focus.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/branch_line_pressed.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/branch_more.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/branch_more_disabled.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/branch_more_focus.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/branch_more_pressed.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/branch_open.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/branch_open_disabled.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/branch_open_focus.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/branch_open_pressed.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/checkbox_checked.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/checkbox_checked_disabled.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/checkbox_checked_focus.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/checkbox_checked_pressed.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/checkbox_indeterminate.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/checkbox_indeterminate_disabled.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/checkbox_indeterminate_focus.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/checkbox_indeterminate_pressed.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/checkbox_unchecked.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/checkbox_unchecked_disabled.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/checkbox_unchecked_focus.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/checkbox_unchecked_pressed.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/line_horizontal.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/line_horizontal_disabled.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/line_horizontal_focus.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/line_horizontal_pressed.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/line_vertical.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/line_vertical_disabled.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/line_vertical_focus.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/line_vertical_pressed.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/radio_checked.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/radio_checked_disabled.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/radio_checked_focus.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/radio_checked_pressed.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/radio_unchecked.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/radio_unchecked_disabled.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/radio_unchecked_focus.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/radio_unchecked_pressed.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/toolbar_move_horizontal.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/toolbar_move_horizontal_disabled.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/toolbar_move_horizontal_focus.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/toolbar_move_horizontal_pressed.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/toolbar_move_vertical.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/toolbar_move_vertical_disabled.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/toolbar_move_vertical_focus.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/toolbar_move_vertical_pressed.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/toolbar_separator_horizontal.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/toolbar_separator_vertical.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/toolbar_separator_vertical_focus.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/transparent.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/transparent_disabled.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/transparent_focus.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/transparent_pressed.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/window_close.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/window_close_disabled.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/window_close_focus.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/window_close_pressed.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/window_grip.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/window_grip_disabled.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/window_grip_focus.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/window_grip_pressed.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/window_minimize.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/window_minimize_disabled.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/window_minimize_focus.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/window_minimize_pressed.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/window_undock.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/window_undock_disabled.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/window_undock_focus.png
Binary file added styles/dark/rc/[email protected]
Binary file added styles/dark/rc/window_undock_pressed.png
Binary file added styles/dark/rc/[email protected]
Loading

0 comments on commit 610ede6

Please sign in to comment.