Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
7ab7aaf
Minimum Qt version required is 6.7
luisangelsm Feb 26, 2026
392e4a0
Move check button svgs paths out from theme params
luisangelsm Feb 27, 2026
0841469
Replace the info shadow pngs with svg versions and make them themable
luisangelsm Feb 27, 2026
0e91176
Remove unused images and server v1 files
luisangelsm Feb 27, 2026
4720705
Remove useStyledTemplate
luisangelsm Feb 27, 2026
d71048b
Fully customize the content views toolbar
luisangelsm Feb 27, 2026
b62ce07
Simplify the sidebar splitter theming
luisangelsm Feb 28, 2026
61a0b59
Add more parameters to control library item style
luisangelsm Feb 28, 2026
7e7c6a9
Add TODO to document bug in recolorSvgXML
luisangelsm Feb 28, 2026
2beb00c
Add more custom colors to the side bar elements so we can theme selec…
luisangelsm Feb 28, 2026
e10e6dc
Rename comics table view header parameters
luisangelsm Feb 28, 2026
368b3bd
Add control over comics table view item top/bottom borders size
luisangelsm Feb 28, 2026
6466739
Add a explicit parameter to control the top gradient value in the com…
luisangelsm Feb 28, 2026
66c9047
Update some of the light theme values
luisangelsm Mar 1, 2026
52e4319
Fix blur background setting
luisangelsm Mar 1, 2026
87fada6
Make the blur backgroud color overlay themable
luisangelsm Mar 1, 2026
547e48c
Use json file based themes instead of code to create them (theme edit…
luisangelsm Mar 2, 2026
e0930d7
Rename YACReaderLibrary json theme sections to be more user friendly
luisangelsm Mar 2, 2026
2d66987
Make json keys display as human readable strings in the theme editor
luisangelsm Mar 2, 2026
ad28216
Fix qrc prefix
luisangelsm Mar 3, 2026
3799c06
Reformat json theme files so the content is sorted alphabetically all…
luisangelsm Mar 3, 2026
5058f47
Tweak default dark YACReaderLibrary theme
luisangelsm Mar 4, 2026
46661be
Implement theme pickers + importing
luisangelsm Mar 5, 2026
df03b1c
Print clang-format version in CI
luisangelsm Mar 5, 2026
d8678bc
Update .clang-format
luisangelsm Mar 5, 2026
a876f33
Format
luisangelsm Mar 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Standard: Cpp11
ColumnLimit: 0

# We want a space between the type and the star for pointer types.
PointerBindsToType: false
DerivePointerAlignment: false
PointerAlignment: Right

# We use template< without space.
SpaceAfterTemplateKeyword: false
Expand Down Expand Up @@ -43,7 +44,7 @@ NamespaceIndentation: None
# The coding style does not specify the following, but this is what gives
# results closest to the existing code.
AlignAfterOpenBracket: true
AlwaysBreakTemplateDeclarations: true
BreakTemplateDeclarations: Yes

# Ideally we should also allow less short function in a single line, but
# clang-format does not handle that.
Expand All @@ -60,3 +61,6 @@ ForEachMacros: [ foreach, BOOST_FOREACH, forever, Q_FOREVER, QBENCHMARK, QBENC

# Break constructor initializers before the colon and after the commas.
BreakConstructorInitializers: BeforeColon

# Empty blocks should be {}
SpaceInEmptyBraces: Always
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ jobs:
- name: Install dependencies
run: brew install clang-format

- name: Print clang-format version
run: clang-format --version

- name: Run clang-format
run: |
find . \( -name '*.h' -or -name '*.cpp' -or -name '*.c' -or -name '*.mm' -or -name '*.m' \) -print0 | xargs -0 clang-format -style=file -i
Expand Down
4 changes: 4 additions & 0 deletions YACReader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,13 @@ target_compile_definitions(YACReader PRIVATE YACREADER)
# Resources
qt_add_resources(yacreader_images_rcc "${CMAKE_CURRENT_SOURCE_DIR}/yacreader_images.qrc")
qt_add_resources(yacreader_files_rcc "${CMAKE_CURRENT_SOURCE_DIR}/yacreader_files.qrc")
qt_add_resources(yacreader_themes_rcc "${CMAKE_CURRENT_SOURCE_DIR}/themes/themes.qrc")
qt_add_resources(yacreader_common_images_rcc "${CMAKE_SOURCE_DIR}/common/themes/appearance_config_images.qrc")
target_sources(YACReader PRIVATE
${yacreader_images_rcc}
${yacreader_files_rcc}
${yacreader_themes_rcc}
${yacreader_common_images_rcc}
)

# Translations
Expand Down
9 changes: 8 additions & 1 deletion YACReader/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
#include "main_window_viewer.h"
#include "configuration.h"
#include "exit_check.h"
#include "appearance_configuration.h"
#include "theme_manager.h"
#include "theme_repository.h"
#include "yacreader_global.h"

#include "QsLog.h"
#include "QsLogDest.h"
Expand Down Expand Up @@ -114,7 +117,11 @@ int main(int argc, char *argv[])
app.setApplicationName("YACReader");
app.setOrganizationName("YACReader");

ThemeManager::instance().initialize();
auto *appearanceConfig = new AppearanceConfiguration(
YACReader::getSettingsPath() + "/YACReader.ini", qApp);
auto *themeRepo = new ThemeRepository(
":/themes", YACReader::getSettingsPath() + "/themes/user");
ThemeManager::instance().initialize(appearanceConfig, themeRepo);

if (QIcon::hasThemeIcon("YACReader")) {
app.setWindowIcon(QIcon::fromTheme("YACReader"));
Expand Down
15 changes: 15 additions & 0 deletions YACReader/options_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
#include <QLabel>
#include <QColorDialog>
#include <QCheckBox>
#include <QMessageBox>
#include "theme_manager.h"
#include "theme_factory.h"
#include "appearance_tab_widget.h"

#include "yacreader_spin_slider_widget.h"
#include "yacreader_3d_flow_config_widget.h"
Expand Down Expand Up @@ -203,9 +206,21 @@ OptionsDialog::OptionsDialog(QWidget *parent)
pageFlow->setLayout(layoutFlow);
pageImage->setLayout(layoutImageV);

// APPEARANCE ----------------------------------------

auto *pageAppearance = new AppearanceTabWidget(
ThemeManager::instance().getAppearanceConfiguration(),
ThemeManager::instance().getRepository(),
[]() { return ThemeManager::instance().getCurrentTheme().sourceJson; },
[](const QJsonObject &json) { ThemeManager::instance().setTheme(makeTheme(json)); },
this);

// APPEARANCE END ------------------------------------

tabWidget->addTab(pageGeneral, tr("General"));
tabWidget->addTab(pageFlow, tr("Page Flow"));
tabWidget->addTab(pageImage, tr("Image adjustment"));
tabWidget->addTab(pageAppearance, tr("Appearance"));

layout->addWidget(tabWidget);

Expand Down
2 changes: 2 additions & 0 deletions YACReader/options_dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include "yacreader_options_dialog.h"
#include "themable.h"

#include <QPointer>

class QDialog;
class QLabel;
class QLineEdit;
Expand Down
2 changes: 1 addition & 1 deletion YACReader/render.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ void Render::fillBuffer()
pageRenders[currentPageBufferedIndex + i]->start();
}

if ((currentIndex - i > 0) &&
if ((currentIndex - i >= 0) &&
buffer[currentPageBufferedIndex - i]->isNull() &&
i <= numLeftPages &&
pageRenders[currentPageBufferedIndex - i] == 0 &&
Expand Down
51 changes: 51 additions & 0 deletions YACReader/themes/builtin_classic.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"goToFlowWidget": {
"editBackgroundColor": "#55000000",
"editBorderColor": "#77000000",
"editTextColor": "#ffffff",
"flowBackgroundColor": "#282828",
"flowTextColor": "#ffffff",
"iconColor": "#ffffff",
"labelTextColor": "#ffffff",
"sliderBorderColor": "#22ffffff",
"sliderGrooveColor": "#77000000",
"sliderHandleColor": "#55ffffff",
"toolbarBackgroundColor": "#99000000"
},
"helpAboutDialog": {
"headingColor": "#302f2d",
"linkColor": "#c19441"
},
"meta": {
"displayName": "Default Classic",
"id": "builtin/classic",
"variant": "dark"
},
"shortcutsIcons": {
"iconColor": "#404040"
},
"toolbar": {
"backgroundColor": "#f3f3f3",
"checkedButtonColor": "#cccccc",
"iconCheckedColor": "#5a5a5a",
"iconColor": "#404040",
"iconDisabledColor": "#858585",
"menuIndicatorColor": "#404040",
"separatorColor": "#cccccc"
},
"viewer": {
"defaultBackgroundColor": "#282828",
"defaultTextColor": "#ffffff",
"infoBackgroundColor": "#bb000000",
"infoTextColor": "#ffffff"
},
"whatsNewDialog": {
"backgroundColor": "#ffffff",
"closeButtonColor": "#444444",
"contentTextColor": "#0a0a0a",
"headerDecorationColor": "#e8b800",
"headerTextColor": "#0a0a0a",
"linkColor": "#e8b800",
"versionTextColor": "#858585"
}
}
51 changes: 51 additions & 0 deletions YACReader/themes/builtin_dark.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"goToFlowWidget": {
"editBackgroundColor": "#55000000",
"editBorderColor": "#77000000",
"editTextColor": "#ffffff",
"flowBackgroundColor": "#282828",
"flowTextColor": "#ffffff",
"iconColor": "#cccccc",
"labelTextColor": "#ffffff",
"sliderBorderColor": "#22ffffff",
"sliderGrooveColor": "#77000000",
"sliderHandleColor": "#55ffffff",
"toolbarBackgroundColor": "#99000000"
},
"helpAboutDialog": {
"headingColor": "#e0e0e0",
"linkColor": "#d4a84b"
},
"meta": {
"displayName": "Default Dark",
"id": "builtin/dark",
"variant": "dark"
},
"shortcutsIcons": {
"iconColor": "#d0d0d0"
},
"toolbar": {
"backgroundColor": "#202020",
"checkedButtonColor": "#3a3a3a",
"iconCheckedColor": "#dadada",
"iconColor": "#cccccc",
"iconDisabledColor": "#444444",
"menuIndicatorColor": "#cccccc",
"separatorColor": "#444444"
},
"viewer": {
"defaultBackgroundColor": "#282828",
"defaultTextColor": "#ffffff",
"infoBackgroundColor": "#bb000000",
"infoTextColor": "#b0b0b0"
},
"whatsNewDialog": {
"backgroundColor": "#2a2a2a",
"closeButtonColor": "#dddddd",
"contentTextColor": "#e0e0e0",
"headerDecorationColor": "#e8b800",
"headerTextColor": "#e0e0e0",
"linkColor": "#e8b800",
"versionTextColor": "#858585"
}
}
51 changes: 51 additions & 0 deletions YACReader/themes/builtin_light.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"goToFlowWidget": {
"editBackgroundColor": "#22000000",
"editBorderColor": "#33000000",
"editTextColor": "#202020",
"flowBackgroundColor": "#f6f6f6",
"flowTextColor": "#202020",
"iconColor": "#404040",
"labelTextColor": "#202020",
"sliderBorderColor": "#22000000",
"sliderGrooveColor": "#33000000",
"sliderHandleColor": "#55000000",
"toolbarBackgroundColor": "#bbffffff"
},
"helpAboutDialog": {
"headingColor": "#302f2d",
"linkColor": "#c19441"
},
"meta": {
"displayName": "Default Light",
"id": "builtin/light",
"variant": "light"
},
"shortcutsIcons": {
"iconColor": "#606060"
},
"toolbar": {
"backgroundColor": "#f3f3f3",
"checkedButtonColor": "#cccccc",
"iconCheckedColor": "#5a5a5a",
"iconColor": "#404040",
"iconDisabledColor": "#b0b0b0",
"menuIndicatorColor": "#404040",
"separatorColor": "#cccccc"
},
"viewer": {
"defaultBackgroundColor": "#f6f6f6",
"defaultTextColor": "#202020",
"infoBackgroundColor": "#bbffffff",
"infoTextColor": "#404040"
},
"whatsNewDialog": {
"backgroundColor": "#ffffff",
"closeButtonColor": "#444444",
"contentTextColor": "#0a0a0a",
"headerDecorationColor": "#e8b800",
"headerTextColor": "#0a0a0a",
"linkColor": "#e8b800",
"versionTextColor": "#858585"
}
}
5 changes: 5 additions & 0 deletions YACReader/themes/theme.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
#define THEME_H

#include <QtGui>
#include <QJsonObject>

#include "help_about_dialog_theme.h"
#include "whats_new_dialog_theme.h"
#include "theme_meta.h"

struct ToolbarThemeTemplates {
QString toolbarQSS = "QToolBar { border: none; background: %1; }\n"
Expand Down Expand Up @@ -142,6 +144,9 @@ struct DialogIconsTheme {
};

struct Theme {
ThemeMeta meta;
QJsonObject sourceJson;

ToolbarTheme toolbar;
ViewerTheme viewer;
GoToFlowWidgetTheme goToFlowWidget;
Expand Down
Loading