Skip to content
This repository has been archived by the owner on Jul 15, 2021. It is now read-only.

Commit

Permalink
[Fix] Split themes in different QRC files
Browse files Browse the repository at this point in the history
  • Loading branch information
Feldrise committed Jun 29, 2018
1 parent 182af17 commit b168a49
Show file tree
Hide file tree
Showing 9 changed files with 788 additions and 763 deletions.
12 changes: 9 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,31 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

file(
GLOB_RECURSE
QRC_FILES
*.qrc
)

find_package(OpenSSL 1.1.0 REQUIRED)
find_package(Qt5Widgets 5.8 REQUIRED)
find_package(Qt5WebEngine 5.8 REQUIRED)
find_package(Qt5WebEngineWidgets 5.8 REQUIRED)

if (WIN32)
add_executable(sielo-browser WIN32 ${SOURCE_FILES} icons.qrc data.qrc ic_sielo.rc)
add_executable(sielo-browser WIN32 ${SOURCE_FILES} ${QRC_FILES} ic_sielo.rc)

# deploy
get_target_property(QT5_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION)
get_filename_component(QT5_WINDEPLOYQT_EXECUTABLE ${QT5_QMAKE_EXECUTABLE} PATH)
set(QT5_WINDEPLOYQT_EXECUTABLE "${QT5_WINDEPLOYQT_EXECUTABLE}/windeployqt.exe")

elseif(APPLE)
add_executable(sielo-browser MACOSX_BUNDLE ${SOURCE_FILES} ${ICON_PATH} icons.qrc data.qrc)
add_executable(sielo-browser MACOSX_BUNDLE ${SOURCE_FILES} ${ICON_PATH} ${QRC_FILES})
set_source_files_properties(${ICON_PATH} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
set_target_properties(sielo-browser PROPERTIES MACOSX_BUNDLE_ICON_FILE ${ICON_NAME})
else()
add_executable(sielo-browser ${SOURCE_FILES} icons.qrc data.qrc)
add_executable(sielo-browser ${SOURCE_FILES} ${QRC_FILES})
endif()

if(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 8)
Expand Down
153 changes: 153 additions & 0 deletions ColorZilla.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
<RCC>
<qresource prefix="/">
<!-- ColorZilla theme -->
<file>data/themes/ColorZilla/dark/edit/edit-clear.png</file>
<file>data/themes/ColorZilla/dark/edit/edit-copy.png</file>
<file>data/themes/ColorZilla/dark/edit/edit-cut.png</file>
<file>data/themes/ColorZilla/dark/edit/edit-delete.png</file>
<file>data/themes/ColorZilla/dark/edit/edit-past.png</file>
<file>data/themes/ColorZilla/dark/edit/edit-redo.png</file>
<file>data/themes/ColorZilla/dark/edit/edit-select-all.png</file>
<file>data/themes/ColorZilla/dark/edit/edit-undo.png</file>
<file>data/themes/ColorZilla/dark/other/add-bookmark.png</file>
<file>data/themes/ColorZilla/dark/other/arrow-down.png</file>
<file>data/themes/ColorZilla/dark/other/arrow-left.png</file>
<file>data/themes/ColorZilla/dark/other/arrow-right.png</file>
<file>data/themes/ColorZilla/dark/other/arrow-up.png</file>
<file>data/themes/ColorZilla/dark/other/audiocapture.png</file>
<file>data/themes/ColorZilla/dark/other/bookmarks.png</file>
<file>data/themes/ColorZilla/dark/other/check.png</file>
<file>data/themes/ColorZilla/dark/other/close.png</file>
<file>data/themes/ColorZilla/dark/other/downloads.png</file>
<file>data/themes/ColorZilla/dark/other/exit.png</file>
<file>data/themes/ColorZilla/dark/other/geolocation.png</file>
<file>data/themes/ColorZilla/dark/other/go.png</file>
<file>data/themes/ColorZilla/dark/other/google.png</file>
<file>data/themes/ColorZilla/dark/other/heart.png</file>
<file>data/themes/ColorZilla/dark/other/history.png</file>
<file>data/themes/ColorZilla/dark/other/home.png</file>
<file>data/themes/ColorZilla/dark/other/locked.png</file>
<file>data/themes/ColorZilla/dark/other/login.png</file>
<file>data/themes/ColorZilla/dark/other/mouselock.png</file>
<file>data/themes/ColorZilla/dark/other/new-window.png</file>
<file>data/themes/ColorZilla/dark/other/nonlocked.png</file>
<file>data/themes/ColorZilla/dark/other/notification.png</file>
<file>data/themes/ColorZilla/dark/other/open-file.png</file>
<file>data/themes/ColorZilla/dark/other/reload.png</file>
<file>data/themes/ColorZilla/dark/other/round.png</file>
<file>data/themes/ColorZilla/dark/other/search.png</file>
<file>data/themes/ColorZilla/dark/other/stop.png</file>
<file>data/themes/ColorZilla/dark/other/webcam.png</file>
<file>data/themes/ColorZilla/dark/other/webpage.png</file>
<file>data/themes/ColorZilla/dark/preferences/adblock.png</file>
<file>data/themes/ColorZilla/dark/preferences/appearance.png</file>
<file>data/themes/ColorZilla/dark/preferences/current-tabsspace.png</file>
<file>data/themes/ColorZilla/dark/preferences/download.png</file>
<file>data/themes/ColorZilla/dark/preferences/local-storage.png</file>
<file>data/themes/ColorZilla/dark/preferences/passwords.png</file>
<file>data/themes/ColorZilla/dark/preferences/preferences.png</file>
<file>data/themes/ColorZilla/dark/preferences/privacy.png</file>
<file>data/themes/ColorZilla/dark/preferences/proxy.png</file>
<file>data/themes/ColorZilla/dark/preferences/settings.png</file>
<file>data/themes/ColorZilla/dark/preferences/web-configs.png</file>
<file>data/themes/ColorZilla/dark/tabs/anonymous.png</file>
<file>data/themes/ColorZilla/dark/tabs/audiomuted.png</file>
<file>data/themes/ColorZilla/dark/tabs/audioplaying.png</file>
<file>data/themes/ColorZilla/dark/tabs/duplicate.png</file>
<file>data/themes/ColorZilla/dark/tabs/loading.png</file>
<file>data/themes/ColorZilla/dark/tabs/tabbar-addtab.png</file>
<file>data/themes/ColorZilla/dark/tabs/tabbar-left-arrow.png</file>
<file>data/themes/ColorZilla/dark/tabs/tabbar-right-arrow.png</file>
<file>data/themes/ColorZilla/dark/tabs/tabbar-tabslist.png</file>
<file>data/themes/ColorZilla/dark/titlebar/tb-close.png</file>
<file>data/themes/ColorZilla/dark/titlebar/tb-revert-maximize.png</file>
<file>data/themes/ColorZilla/dark/titlebar/tb-maximize.png</file>
<file>data/themes/ColorZilla/dark/titlebar/tb-minimize.png</file>
<file>data/themes/ColorZilla/dark/add-bookmark.png</file>
<file>data/themes/ColorZilla/dark/back.png</file>
<file>data/themes/ColorZilla/dark/history.png</file>
<file>data/themes/ColorZilla/dark/home.png</file>
<file>data/themes/ColorZilla/dark/icon.png</file>
<file>data/themes/ColorZilla/dark/index.theme</file>
<file>data/themes/ColorZilla/dark/new-tab.png</file>
<file>data/themes/ColorZilla/dark/new-window.png</file>
<file>data/themes/ColorZilla/dark/next.png</file>
<file>data/themes/ColorZilla/dark/view-bookmarks.png</file>
<file>data/themes/ColorZilla/light/edit/edit-clear.png</file>
<file>data/themes/ColorZilla/light/edit/edit-copy.png</file>
<file>data/themes/ColorZilla/light/edit/edit-cut.png</file>
<file>data/themes/ColorZilla/light/edit/edit-delete.png</file>
<file>data/themes/ColorZilla/light/edit/edit-past.png</file>
<file>data/themes/ColorZilla/light/edit/edit-redo.png</file>
<file>data/themes/ColorZilla/light/edit/edit-select-all.png</file>
<file>data/themes/ColorZilla/light/edit/edit-undo.png</file>
<file>data/themes/ColorZilla/light/other/add-bookmark.png</file>
<file>data/themes/ColorZilla/light/other/arrow-down.png</file>
<file>data/themes/ColorZilla/light/other/arrow-left.png</file>
<file>data/themes/ColorZilla/light/other/arrow-right.png</file>
<file>data/themes/ColorZilla/light/other/arrow-up.png</file>
<file>data/themes/ColorZilla/light/other/audiocapture.png</file>
<file>data/themes/ColorZilla/light/other/bookmarks.png</file>
<file>data/themes/ColorZilla/light/other/check.png</file>
<file>data/themes/ColorZilla/light/other/close.png</file>
<file>data/themes/ColorZilla/light/other/downloads.png</file>
<file>data/themes/ColorZilla/light/other/exit.png</file>
<file>data/themes/ColorZilla/light/other/geolocation.png</file>
<file>data/themes/ColorZilla/light/other/go.png</file>
<file>data/themes/ColorZilla/light/other/google.png</file>
<file>data/themes/ColorZilla/light/other/heart.png</file>
<file>data/themes/ColorZilla/light/other/history.png</file>
<file>data/themes/ColorZilla/light/other/home.png</file>
<file>data/themes/ColorZilla/light/other/locked.png</file>
<file>data/themes/ColorZilla/light/other/login.png</file>
<file>data/themes/ColorZilla/light/other/mouselock.png</file>
<file>data/themes/ColorZilla/light/other/new-window.png</file>
<file>data/themes/ColorZilla/light/other/nonlocked.png</file>
<file>data/themes/ColorZilla/light/other/notification.png</file>
<file>data/themes/ColorZilla/light/other/open-file.png</file>
<file>data/themes/ColorZilla/light/other/reload.png</file>
<file>data/themes/ColorZilla/light/other/round.png</file>
<file>data/themes/ColorZilla/light/other/search.png</file>
<file>data/themes/ColorZilla/light/other/stop.png</file>
<file>data/themes/ColorZilla/light/other/webcam.png</file>
<file>data/themes/ColorZilla/light/other/webpage.png</file>
<file>data/themes/ColorZilla/light/preferences/adblock.png</file>
<file>data/themes/ColorZilla/light/preferences/appearance.png</file>
<file>data/themes/ColorZilla/light/preferences/current-tabsspace.png</file>
<file>data/themes/ColorZilla/light/preferences/download.png</file>
<file>data/themes/ColorZilla/light/preferences/local-storage.png</file>
<file>data/themes/ColorZilla/light/preferences/passwords.png</file>
<file>data/themes/ColorZilla/light/preferences/preferences.png</file>
<file>data/themes/ColorZilla/light/preferences/privacy.png</file>
<file>data/themes/ColorZilla/light/preferences/proxy.png</file>
<file>data/themes/ColorZilla/light/preferences/settings.png</file>
<file>data/themes/ColorZilla/light/preferences/web-configs.png</file>
<file>data/themes/ColorZilla/light/tabs/anonymous.png</file>
<file>data/themes/ColorZilla/light/tabs/audiomuted.png</file>
<file>data/themes/ColorZilla/light/tabs/audioplaying.png</file>
<file>data/themes/ColorZilla/light/tabs/duplicate.png</file>
<file>data/themes/ColorZilla/light/tabs/loading.png</file>
<file>data/themes/ColorZilla/light/tabs/tabbar-addtab.png</file>
<file>data/themes/ColorZilla/light/tabs/tabbar-left-arrow.png</file>
<file>data/themes/ColorZilla/light/tabs/tabbar-right-arrow.png</file>
<file>data/themes/ColorZilla/light/tabs/tabbar-tabslist.png</file>
<file>data/themes/ColorZilla/light/titlebar/tb-close.png</file>
<file>data/themes/ColorZilla/light/titlebar/tb-revert-maximize.png</file>
<file>data/themes/ColorZilla/light/titlebar/tb-maximize.png</file>
<file>data/themes/ColorZilla/light/titlebar/tb-minimize.png</file>
<file>data/themes/ColorZilla/light/add-bookmark.png</file>
<file>data/themes/ColorZilla/light/back.png</file>
<file>data/themes/ColorZilla/light/history.png</file>
<file>data/themes/ColorZilla/light/home.png</file>
<file>data/themes/ColorZilla/light/icon.png</file>
<file>data/themes/ColorZilla/light/index.theme</file>
<file>data/themes/ColorZilla/light/new-tab.png</file>
<file>data/themes/ColorZilla/light/new-window.png</file>
<file>data/themes/ColorZilla/light/next.png</file>
<file>data/themes/ColorZilla/light/view-bookmarks.png</file>
<file>data/themes/ColorZilla/images/background.png</file>
<file>data/themes/ColorZilla/main.sss</file>
<file>data/themes/ColorZilla/theme.info</file>
<file>data/themes/ColorZilla/theme.png</file>
</qresource>
</RCC>
8 changes: 4 additions & 4 deletions Core/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ void Application::loadThemesSettings()
// Check if the theme existe
if (themeInfo.exists()) {
// Check default theme version and update it if needed
if (settings.value("Themes/defaultThemeVersion", 1).toInt() < 41) {
if (settings.value("Themes/defaultThemeVersion", 1).toInt() < 42) {
if (settings.value("Themes/defaultThemeVersion", 1).toInt() < 11) {
QString defaultThemePath{paths()[Application::P_Themes]};

Expand All @@ -480,7 +480,7 @@ void Application::loadThemesSettings()
loadThemeFromResources("round-theme", false);
loadThemeFromResources("ColorZilla", false);
loadThemeFromResources("sielo-default", false);
settings.setValue("Themes/defaultThemeVersion", 41);
settings.setValue("Themes/defaultThemeVersion", 42);
}

loadTheme(settings.value("Themes/currentTheme", QLatin1String("sielo-default")).toString(),
Expand All @@ -494,7 +494,7 @@ void Application::loadThemesSettings()
loadThemeFromResources("round-theme", false);
loadThemeFromResources("ColorZilla", false);
loadThemeFromResources();
settings.setValue("Themes/defaultThemeVersion", 41);
settings.setValue("Themes/defaultThemeVersion", 42);
}
}

Expand Down Expand Up @@ -1335,7 +1335,7 @@ QImage Application::blurImage(const QImage& image, const QRect& rect, int radius
void Application::loadThemeFromResources(QString name, bool loadAtEnd)
{
QString defaultThemePath{paths()[Application::P_Themes]};
QString defaultThemeDataPath{":data/themes/" + name};
QString defaultThemeDataPath{":/" + name + "/data/themes/" + name};

defaultThemePath += QLatin1Char('/') + name;

Expand Down
Loading

0 comments on commit b168a49

Please sign in to comment.