Skip to content

Commit 67523b9

Browse files
authored
#11 : Implement Light and Dark Theme System (#12)
- Use latest TGUI version - Add light theme - New class ThemeManager with system theme detection. - Refactor components for using theme instead of hardcoded colors - Add some rules in .editorconfig and fix some style guide issues
1 parent 3fd7ccb commit 67523b9

Some content is hidden

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

47 files changed

+1028
-507
lines changed

.editorconfig

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,34 @@ end_of_line = lf
55
insert_final_newline = true
66

77
[*.{c++,cc,cpp,cxx,h,h++,hh,hpp,hxx,inl,ipp,tlh,tli}]
8-
cpp_indent_case_contents_when_block = true
9-
cpp_new_line_before_open_brace_namespace = same_line
108
indent_size = 4
119
indent_style = space
10+
11+
# Braces and new lines
12+
cpp_new_line_before_open_brace_namespace = same_line
13+
cpp_new_line_before_open_brace_type = same_line
14+
cpp_new_line_before_open_brace_function = same_line
15+
cpp_new_line_before_open_brace_block = same_line
16+
cpp_new_line_before_open_brace_lambda = same_line
17+
cpp_new_line_before_else = false
18+
cpp_new_line_before_catch = false
19+
20+
# Pointers and references
21+
cpp_space_pointer_reference_alignment = right
22+
23+
# General spacing
24+
cpp_space_before_function_open_parenthesis = never
25+
cpp_space_after_keywords_in_control_flow_statements = true
26+
cpp_space_within_control_flow_statement_parentheses = false
27+
cpp_space_before_block_open_brace = true
28+
cpp_space_after_comma = true
29+
cpp_space_before_comma = false
30+
cpp_space_within_initializer_list_braces = false
31+
32+
# Indentation
33+
cpp_indent_case_contents_when_block = true
34+
cpp_indent_namespace_contents = true
35+
cpp_indent_lambda_braces_when_parameter = false
36+
cpp_indent_multi_line_relative_to = statement_begin
37+
cpp_indent_within_parentheses = indent
38+
cpp_indent_preserve_within_parentheses = true

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ add_executable(file-share
6060
source/main.cpp
6161
source/Application.cpp
6262
source/Debug.cpp
63+
source/ThemeManager.cpp
6364
source/Components/Button.cpp
6465
source/Components/Foldout.cpp
6566
source/Components/InputFileDialog.cpp
@@ -70,6 +71,14 @@ add_executable(file-share
7071

7172
target_compile_definitions(file-share PRIVATE _LARGEFILE_SOURCE _FILE_OFFSET_BITS=64)
7273
target_link_libraries(file-share tgui sfml-graphics sfml-window sfml-system sqlite_orm::sqlite_orm fsp)
74+
75+
# Platform-specific libraries for theme detection
76+
if(APPLE)
77+
target_link_libraries(file-share "-framework CoreFoundation")
78+
elseif(WIN32)
79+
target_link_libraries(file-share winreg)
80+
endif()
81+
7382
target_compile_options(file-share PRIVATE
7483
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:-Wall -Wextra>
7584
$<$<CXX_COMPILER_ID:MSVC>:/W4>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)