Skip to content
This repository has been archived by the owner on Apr 26, 2020. It is now read-only.

Commit

Permalink
feat: support dark theme
Browse files Browse the repository at this point in the history
Change-Id: Ib04603c4499e414bf6da9fee90d2e8d7a49100a0
  • Loading branch information
Iceyer committed Aug 20, 2018
1 parent ffaa255 commit 50acea6
Show file tree
Hide file tree
Showing 48 changed files with 694 additions and 293 deletions.
63 changes: 30 additions & 33 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,6 @@ set(UI_FILES
ui/channel/store_daemon_proxy.cpp
ui/channel/store_daemon_proxy.h

ui/utils/theme_manager.cpp
ui/utils/theme_manager.h

ui/widgets/image_viewer.cpp
ui/widgets/image_viewer.h
ui/widgets/search_button.cpp
Expand All @@ -200,38 +197,38 @@ add_custom_target(update-qm DEPENDS ${DMAN_TRANSLATION_QM})
# Update angular dist/. Works on x86 based platforms.
add_custom_command(OUTPUT npm-update-web-dist
COMMAND sh -c "PATH=./node_modules/.bin:$PATH npm run build"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/web"
VERBATIM
)
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/web"
VERBATIM
)
add_custom_target(update-web-dist DEPENDS npm-update-web-dist)

add_executable(deepin-appstore
app/deepin_appstore.cpp
${BASE_FILES}
${DBUS_FILES}
${RESOURCES_FILES}
${SERVICES_FILES}
${UI_FILES}
)
${BASE_FILES}
${DBUS_FILES}
${RESOURCES_FILES}
${SERVICES_FILES}
${UI_FILES}
)
target_link_libraries(deepin-appstore ${LINK_LIBS})
if (CMAKE_BUILD_TYPE MATCHES Release)
add_dependencies(deepin-appstore
update-qm
update-web-dist)
update-web-dist)
endif()

if (CMAKE_BUILD_TYPE MATCHES Debug)
add_executable(test-launcher
app/test_launcher.cpp
base/launcher.cpp
base/launcher.h
)
base/launcher.cpp
base/launcher.h
)
target_link_libraries(test-launcher ${LINK_LIBS})
add_executable(test-base64-image
app/base64_image.cpp
base/file_util.cpp
base/file_util.h
)
base/file_util.cpp
base/file_util.h
)
target_link_libraries(test-base64-image ${LINK_LIBS})

add_executable(qurl-demo app/qurl_demo.cpp)
Expand All @@ -240,32 +237,32 @@ if (CMAKE_BUILD_TYPE MATCHES Debug)
add_executable(test-image-viewer
app/test_image_viewer.cpp

base/file_util.cpp
base/file_util.h
ui/utils/theme_manager.cpp
ui/utils/theme_manager.h
ui/widgets/image_viewer.cpp
ui/widgets/image_viewer.h
base/file_util.cpp
base/file_util.h
ui/utils/theme_manager.cpp
ui/utils/theme_manager.h
ui/widgets/image_viewer.cpp
ui/widgets/image_viewer.h

resources/themes/themes.qrc
)
resources/themes/themes.qrc
)
target_link_libraries(test-image-viewer ${LINK_LIBS})
endif()

add_executable(deepin-appstore-metadata

app/deepin_appstore_metadata.cpp

${BASE_FILES}
${DBUS_FILES}
${SERVICES_FILES}
)
${BASE_FILES}
${DBUS_FILES}
${SERVICES_FILES}
)
target_link_libraries(deepin-appstore-metadata ${Qt_LIBS})

install(TARGETS
deepin-appstore
deepin-appstore-metadata
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
deepin-appstore-metadata
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)


install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/web_dist
Expand Down
20 changes: 11 additions & 9 deletions src/app/deepin_appstore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const char kDisableGpu[] = "--disable-gpu";
const char kEnableLogging[] = "--enable-logging";
const char kLogLevel[] = "--log-level";

} // namespace
} // namespace

int main(int argc, char** argv) {
qputenv("DXCB_FAKE_PLATFORM_NAME_XCB", "true");
Expand All @@ -45,15 +45,17 @@ int main(int argc, char** argv) {
QCefGlobalSettings settings;
// Do not use sandbox.
settings.setNoSandbox(true);
#ifndef NDEBUG
// Open http://localhost:9222 in chromium browser to see dev tools.
settings.setRemoteDebug(true);
settings.setIgnoresCertificateErrors(true);
#else
settings.setRemoteDebug(false);
#endif

if (qEnvironmentVariableIntValue("DSTORE_DEBUG") == 1) {
// Open http://localhost:9222 in chromium browser to see dev tools.
settings.setRemoteDebug(true);
settings.setLogSeverity(QCefGlobalSettings::LogSeverity::Verbose);
} else {
settings.setRemoteDebug(false);
settings.setLogSeverity(QCefGlobalSettings::LogSeverity::Error);
}

settings.setIgnoresCertificateErrors(true);
settings.setLogSeverity(QCefGlobalSettings::LogSeverity::Error);

// Disable GPU process.
settings.addCommandLineSwitch(kDisableGpu, "");
Expand Down
2 changes: 1 addition & 1 deletion src/base/consts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const char kAppName[] = "deepin-appstore";
const char kAppVersion[] = "5.0.2.2";

#ifndef NDEBUG
const char kIndexPage[] = "http://localhost:4200/";
const char kIndexPage[] = "http://localhost:4200/china/";
#else
const char kIndexPage[] = "rcc://web/index.html";
#endif // NDEBUG
Expand Down
18 changes: 18 additions & 0 deletions src/resources/themes/dark/dstore--TitleBar.theme
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

#AppIcon {
image: url(:/common/images/deepin-appstore.svg);
}

#BackButton {
qproperty-normalPic: url(:/dark/images/backward_normal.svg);
qproperty-hoverPic: url(:/dark/images/backward_hover.svg);
qproperty-pressPic: url(:/dark/images/backward_press.svg);
qproperty-disabledPic: url(:/dark/images/backward_insensitive.svg);
}

#ForwardButton {
qproperty-normalPic: url(:/dark/images/forward_normal.svg);
qproperty-hoverPic: url(:/dark/images/forward_hover.svg);
qproperty-pressPic: url(:/dark/images/forward_press.svg);
qproperty-disabledPic: url(:/dark/images/forward_insensitive.svg);
}
4 changes: 4 additions & 0 deletions src/resources/themes/dark/dstore--WebWindow.theme
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Dtk--Widget--DMainWindow {
qproperty-borderColor: rgba(16, 16, 16, 80%);
background-color: transparent;
}
14 changes: 14 additions & 0 deletions src/resources/themes/dark/images/back_hover.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions src/resources/themes/dark/images/back_normal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions src/resources/themes/dark/images/back_press.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions src/resources/themes/dark/images/backward_hover.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions src/resources/themes/dark/images/backward_insensitive.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions src/resources/themes/dark/images/backward_normal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions src/resources/themes/dark/images/backward_press.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 50acea6

Please sign in to comment.