@@ -18,15 +18,15 @@ using ComponentsManager = SettingWindowComponentsManager;
1818 using ZClipboard::AppUtils::LogContext;
1919#endif
2020
21- Self *Self::StartBuild () {
21+ Self *Self::StartBuild () noexcept {
2222 if (!Impl) {
2323 Utils::MakeSmartPtr<DataImpl>(Impl);
2424 }
2525
2626 return this ;
2727}
2828
29- Layout *Self::GetLayout () {
29+ Layout *Self::GetLayout () noexcept {
3030 auto layout = this
3131 -> Impl
3232 -> layout;
@@ -40,7 +40,7 @@ Layout *Self::GetLayout() {
4040 return layout;
4141}
4242
43- ComponentsManager *Self::GetComponentsManager () {
43+ ComponentsManager *Self::GetComponentsManager () noexcept {
4444 auto componentsManager = this
4545 -> Impl
4646 -> componentsManager;
@@ -54,7 +54,7 @@ ComponentsManager *Self::GetComponentsManager() {
5454 return componentsManager;
5555}
5656
57- Self *Self::WhenDone () {
57+ Self *Self::WhenDone () noexcept {
5858 #if defined (Z_DEBUG)
5959 AssertContext{}.RequireNonNullPtr (Impl.get ());
6060 AssertContext{}.RequireNonNullPtr (Impl->componentsManager );
@@ -68,16 +68,121 @@ Self *Self::WhenDone() {
6868 return this ;
6969}
7070
71- Widget Self::GetSetPasswordButtonLayout () {
72- auto componentsManager = this -> GetComponentsManager ();
73- auto layout = this -> GetLayout ();
71+ Widget Self::GetSetPasswordButtonLayout (
72+ Layout *layout,
73+ ComponentsManager *componentsManager) const noexcept {
7474
7575 auto setPasswordButton = componentsManager->GetSetPasswordButton ();
7676
77- auto widgetData = Widget {
77+ const auto widgetData = Widget {
7878 .widget = setPasswordButton,
7979 .row = 3 , .column = 2
8080 };
8181
8282 return widgetData;
83+ }
84+
85+ Widget Self::GetHideWindowSettingCheckboxLayout (
86+ Layout *layout,
87+ ComponentsManager *componentsManager) const noexcept {
88+
89+ auto autoHideCheckbox = componentsManager->GetHideSettingCheckBox ();
90+
91+ const auto widgetData = Widget {
92+ .widget = autoHideCheckbox,
93+ .row = 0 , .column = 0
94+ };
95+
96+ return widgetData;
97+ }
98+
99+ Widget Self::GetNotificationCheckboxLayout (
100+ Layout *layout,
101+ ComponentsManager *componentsManager) const noexcept {
102+
103+ auto notificationCheckbox = componentsManager->GetNotificationCheckBox ();
104+
105+ const auto widgetData = Widget {
106+ .widget = notificationCheckbox,
107+ .row = 1 , .column = 0
108+ };
109+
110+ return widgetData;
111+ }
112+
113+ Widget Self::GetLanguageListBoxLayout (
114+ Layout *layout,
115+ ComponentsManager *componentsManager) const noexcept {
116+
117+ auto languageListBox = componentsManager->GetLanguageListBox ();
118+
119+ const auto widgetData = Widget {
120+ .widget = languageListBox,
121+ .row = 2 , .column = 0
122+ };
123+
124+ return widgetData;
125+ }
126+
127+ Widget Self::GetThemeListBoxLayout (
128+ Layout *layout,
129+ ComponentsManager *componentsManager) const noexcept {
130+
131+ auto themeListBox = componentsManager->GetThemeListBox ();
132+
133+ const auto widgetData = Widget {
134+ .widget = themeListBox,
135+ .row = 3 , .column = 0
136+ };
137+
138+ return widgetData;
139+ }
140+
141+ Widget Self::GetLanguageLabelLayout (
142+ Layout *layout,
143+ ComponentsManager *componentsManager) const noexcept {
144+
145+ auto languageLabel = componentsManager->GetLanguageDescription ();
146+
147+ const auto widgetData = Widget {
148+ .widget = languageLabel,
149+ .row = 2 , .column = 1
150+ };
151+
152+ return widgetData;
153+ }
154+
155+ Widget Self::GetThemeLabelLayout (
156+ Layout *layout,
157+ ComponentsManager *componentsManager) const noexcept {
158+
159+ auto themeLabel = componentsManager->GetThemeDescription ();
160+
161+ const auto widgetData = Widget {
162+ .widget = themeLabel,
163+ .row = 3 , .column = 1
164+ };
165+
166+ return widgetData;
167+ }
168+
169+ void Self::SetupSettingWindowLayout () noexcept {
170+ auto layout = this ->GetLayout ();
171+ auto componentsManager = this ->GetComponentsManager ();
172+
173+ const auto passwordButtonLayout = this ->GetSetPasswordButtonLayout (layout, componentsManager);
174+ const auto hideWindowSettingCheckboxLayout = this ->GetHideWindowSettingCheckboxLayout (layout, componentsManager);
175+ const auto notificationCheckboxLayout = this ->GetNotificationCheckboxLayout (layout, componentsManager);
176+ const auto languageListBoxLayout = this ->GetLanguageListBoxLayout (layout, componentsManager);
177+ const auto themeListBoxLayout = this ->GetThemeListBoxLayout (layout, componentsManager);
178+ const auto languageLabelLayout = this ->GetLanguageLabelLayout (layout, componentsManager);
179+ const auto themeLabelLayout = this ->GetThemeLabelLayout (layout, componentsManager);
180+
181+ GridLayoutAdd (
182+ layout,
183+ passwordButtonLayout, hideWindowSettingCheckboxLayout,
184+ notificationCheckboxLayout, languageListBoxLayout,
185+ themeListBoxLayout, languageLabelLayout,
186+ themeLabelLayout
187+ );
83188}
0 commit comments