[fractal] account-settings: Don't use AdwPreferencesPage when not needed



commit 42705776252071b4ea72e0f5c611f47b9ceadf22
Author: Kévin Commaille <zecakeh tedomum fr>
Date:   Fri Oct 7 17:51:13 2022 +0200

    account-settings: Don't use AdwPreferencesPage when not needed

 data/resources/style.css                           |  13 +-
 .../ui/account-settings-change-password-subpage.ui | 151 ++++++++++---------
 .../account-settings-deactivate-account-subpage.ui | 137 ++++++++---------
 .../account-settings-import-export-keys-subpage.ui | 164 +++++++++++----------
 4 files changed, 249 insertions(+), 216 deletions(-)
---
diff --git a/data/resources/style.css b/data/resources/style.css
index 5131931c7..b3185398b 100644
--- a/data/resources/style.css
+++ b/data/resources/style.css
@@ -53,10 +53,6 @@ preferencesgroup .body,
   line-height: 140%;
 }
 
-preferencespage.status-page clamp > box  {
-  margin: 42px 12px;
-}
-
 button.row {
   min-height: 50px;
   border-radius: 12px;
@@ -66,6 +62,15 @@ button.row {
   border-radius: 6px;
 }
 
+.form-page scrolledwindow > viewport > clamp > box {
+  margin: 42px 12px;
+  border-spacing: 24px;
+}
+
+box.paragraphs {
+  border-spacing: 12px;
+}
+
 /* Components */
 
 .inline-pill {
diff --git a/data/resources/ui/account-settings-change-password-subpage.ui 
b/data/resources/ui/account-settings-change-password-subpage.ui
index 51623795e..10e8b9169 100644
--- a/data/resources/ui/account-settings-change-password-subpage.ui
+++ b/data/resources/ui/account-settings-change-password-subpage.ui
@@ -1,6 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <template class="ChangePasswordSubpage" parent="GtkBox">
+    <style>
+      <class name="form-page"/>
+    </style>
     <property name="orientation">vertical</property>
     <child>
       <object class="GtkHeaderBar">
@@ -24,79 +27,85 @@
       </object>
     </child>
     <child>
-      <object class="AdwPreferencesPage">
-        <style>
-          <class name="status-page"/>
-        </style>
-        <property name="vexpand">true</property>
-        <child>
-          <object class="AdwPreferencesGroup">
-            <child>
-              <object class="GtkImage">
-                <style>
-                  <class name="extra-large-icon"/>
-                  <class name="error"/>
-                </style>
-                <property name="icon-name">dialog-warning-symbolic</property>
+      <object class="GtkScrolledWindow" id="scrolled_window">
+        <property name="hscrollbar-policy">never</property>
+        <property name="propagate-natural-height">True</property>
+        <property name="vexpand">True</property>
+        <property name="child">
+          <object class="AdwClamp">
+            <property name="child">
+              <object class="GtkBox" id="box">
+                <property name="orientation">vertical</property>
+                <child>
+                  <object class="GtkImage">
+                    <style>
+                      <class name="extra-large-icon"/>
+                      <class name="error"/>
+                    </style>
+                    <property name="icon-name">dialog-warning-symbolic</property>
+                  </object>
+                </child>
+                <child>
+                  <object class="GtkBox">
+                    <style>
+                      <class name="paragraphs"/>
+                    </style>
+                    <property name="orientation">vertical</property>
+                    <child>
+                      <object class="GtkLabel">
+                        <style>
+                          <class name="large-line-height"/>
+                        </style>
+                        <property name="label" translatable="yes">Changing your password will log you out of 
your other sessions.</property>
+                        <property name="wrap">True</property>
+                        <property name="wrap-mode">word-char</property>
+                        <property name="xalign">0.0</property>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkLabel">
+                        <style>
+                          <class name="large-line-height"/>
+                        </style>
+                        <property name="label" translatable="yes">Fractal’s support for encryption is 
unstable so you might lose access to your encrypted message history. It is recommended to backup your 
encryption keys before proceeding.</property>
+                        <property name="wrap">True</property>
+                        <property name="wrap-mode">word-char</property>
+                        <property name="xalign">0.0</property>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child>
+                  <object class="GtkListBox">
+                    <style>
+                      <class name="boxed-list"/>
+                    </style>
+                    <child>
+                      <object class="ComponentsPasswordEntryRow" id="password">
+                        <property name="title" translatable="yes">New Password</property>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="ComponentsPasswordEntryRow" id="confirm_password">
+                        <property name="title" translatable="yes">Confirm New Password</property>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child>
+                  <object class="SpinnerButton" id="button">
+                    <style>
+                      <class name="row"/>
+                      <class name="destructive-action"/>
+                    </style>
+                    <property name="label" translatable="yes">Continue</property>
+                    <property name="sensitive">false</property>
+                  </object>
+                </child>
               </object>
-            </child>
+            </property>
           </object>
-        </child>
-        <child>
-          <object class="AdwPreferencesGroup">
-            <child>
-              <object class="GtkLabel">
-                <style>
-                  <class name="body"/>
-                </style>
-                <property name="label" translatable="yes">Changing your password will log you out of your 
other sessions.</property>
-                <property name="wrap">True</property>
-                <property name="wrap-mode">word-char</property>
-                <property name="xalign">0.0</property>
-                <property name="margin-bottom">12</property>
-              </object>
-            </child>
-            <child>
-              <object class="GtkLabel">
-                <style>
-                  <class name="body"/>
-                </style>
-                <property name="label" translatable="yes">Fractal’s support for encryption is unstable so 
you might lose access to your encrypted message history. It is recommended to backup your encryption keys 
before proceeding.</property>
-                <property name="wrap">True</property>
-                <property name="wrap-mode">word-char</property>
-                <property name="xalign">0.0</property>
-              </object>
-            </child>
-          </object>
-        </child>
-        <child>
-          <object class="AdwPreferencesGroup">
-            <child>
-              <object class="ComponentsPasswordEntryRow" id="password">
-                <property name="title" translatable="yes">New Password</property>
-              </object>
-            </child>
-            <child>
-              <object class="ComponentsPasswordEntryRow" id="confirm_password">
-                <property name="title" translatable="yes">Confirm New Password</property>
-              </object>
-            </child>
-          </object>
-        </child>
-        <child>
-          <object class="AdwPreferencesGroup">
-            <child>
-              <object class="SpinnerButton" id="button">
-                <style>
-                  <class name="row"/>
-                  <class name="destructive-action"/>
-                </style>
-                <property name="label" translatable="yes">Continue</property>
-                <property name="sensitive">false</property>
-              </object>
-            </child>
-          </object>
-        </child>
+        </property>
       </object>
     </child>
   </template>
diff --git a/data/resources/ui/account-settings-deactivate-account-subpage.ui 
b/data/resources/ui/account-settings-deactivate-account-subpage.ui
index 41217cbdd..c33b17e6b 100644
--- a/data/resources/ui/account-settings-deactivate-account-subpage.ui
+++ b/data/resources/ui/account-settings-deactivate-account-subpage.ui
@@ -1,6 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <template class="DeactivateAccountSubpage" parent="GtkBox">
+    <style>
+      <class name="form-page"/>
+    </style>
     <property name="orientation">vertical</property>
     <child>
       <object class="GtkHeaderBar">
@@ -24,75 +27,75 @@
       </object>
     </child>
     <child>
-      <object class="AdwPreferencesPage">
-        <style>
-          <class name="status-page"/>
-        </style>
-        <property name="vexpand">true</property>
-        <child>
-          <object class="AdwPreferencesGroup">
-            <child>
-              <object class="GtkImage">
-                <style>
-                  <class name="extra-large-icon"/>
-                  <class name="error"/>
-                </style>
-                <property name="icon-name">dialog-warning-symbolic</property>
+      <object class="GtkScrolledWindow" id="scrolled_window">
+        <property name="hscrollbar-policy">never</property>
+        <property name="propagate-natural-height">True</property>
+        <property name="vexpand">True</property>
+        <property name="child">
+          <object class="AdwClamp">
+            <property name="child">
+              <object class="GtkBox" id="box">
+                <property name="orientation">vertical</property>
+                <child>
+                  <object class="GtkImage">
+                    <style>
+                      <class name="extra-large-icon"/>
+                      <class name="error"/>
+                    </style>
+                    <property name="icon-name">dialog-warning-symbolic</property>
+                  </object>
+                </child>
+                <child>
+                  <object class="GtkBox">
+                    <style>
+                      <class name="paragraphs"/>
+                    </style>
+                    <property name="orientation">vertical</property>
+                    <child>
+                      <object class="GtkLabel">
+                        <style>
+                          <class name="large-line-height"/>
+                        </style>
+                        <property name="label" translatable="yes">Deactivating your account means you will 
lose access to all your messages, contacts, files, and more, forever.</property>
+                        <property name="wrap">True</property>
+                        <property name="wrap-mode">word-char</property>
+                        <property name="xalign">0.0</property>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkLabel">
+                        <style>
+                          <class name="large-line-height"/>
+                        </style>
+                        <property name="label" translatable="yes">To confirm that you really want to 
deactivate this account, type in your Matrix user ID:</property>
+                        <property name="wrap">True</property>
+                        <property name="wrap-mode">word-char</property>
+                        <property name="xalign">0.0</property>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child>
+                  <object class="AdwEntryRow" id="confirmation">
+                    <style>
+                      <class name="card"/>
+                    </style>
+                  </object>
+                </child>
+                <child>
+                  <object class="SpinnerButton" id="button">
+                    <style>
+                      <class name="row"/>
+                      <class name="destructive-action"/>
+                    </style>
+                    <property name="label" translatable="yes">Continue</property>
+                    <property name="sensitive">false</property>
+                  </object>
+                </child>
               </object>
-            </child>
+            </property>
           </object>
-        </child>
-        <child>
-          <object class="AdwPreferencesGroup">
-            <child>
-              <object class="GtkLabel">
-                <style>
-                  <class name="body"/>
-                </style>
-                <property name="label" translatable="yes">Deactivating your account means you will lose 
access to all your messages, contacts, files, and more, forever.</property>
-                <property name="wrap">True</property>
-                <property name="wrap-mode">word-char</property>
-                <property name="xalign">0.0</property>
-              </object>
-            </child>
-          </object>
-        </child>
-        <child>
-          <object class="AdwPreferencesGroup">
-            <child>
-              <object class="GtkLabel">
-                <style>
-                  <class name="body"/>
-                </style>
-                <property name="label" translatable="yes">To confirm that you really want to deactivate this 
account, type in your Matrix user ID:</property>
-                <property name="wrap">True</property>
-                <property name="wrap-mode">word-char</property>
-                <property name="xalign">0.0</property>
-              </object>
-            </child>
-          </object>
-        </child>
-        <child>
-          <object class="AdwPreferencesGroup">
-            <child>
-              <object class="AdwEntryRow" id="confirmation"/>
-            </child>
-          </object>
-        </child>
-        <child>
-          <object class="AdwPreferencesGroup">
-            <child>
-              <object class="SpinnerButton" id="button">
-                <style>
-                  <class name="row"/>
-                  <class name="destructive-action"/>
-                </style>
-                <property name="label" translatable="yes">Continue</property>
-                <property name="sensitive">false</property>
-              </object>
-            </child>
-          </object>
-        </child>
+        </property>
       </object>
     </child>
   </template>
diff --git a/data/resources/ui/account-settings-import-export-keys-subpage.ui 
b/data/resources/ui/account-settings-import-export-keys-subpage.ui
index a2fc30576..0618e8013 100644
--- a/data/resources/ui/account-settings-import-export-keys-subpage.ui
+++ b/data/resources/ui/account-settings-import-export-keys-subpage.ui
@@ -1,6 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <template class="ImportExportKeysSubpage" parent="GtkBox">
+    <style>
+      <class name="form-page"/>
+    </style>
     <property name="orientation">vertical</property>
     <child>
       <object class="GtkHeaderBar">
@@ -23,85 +26,98 @@
       </object>
     </child>
     <child>
-      <object class="AdwPreferencesPage">
-        <style>
-          <class name="status-page"/>
-        </style>
-        <property name="vexpand">true</property>
-        <child>
-          <object class="AdwPreferencesGroup">
-            <child>
-              <object class="GtkLabel" id="description">
-                <style>
-                  <class name="body"/>
-                </style>
-                <property name="label"></property>
-                <property name="wrap">True</property>
-                <property name="wrap-mode">word-char</property>
-                <property name="xalign">0.0</property>
-              </object>
-            </child>
-            <child>
-              <object class="GtkLabel" id="instructions">
-                <style>
-                  <class name="body"/>
-                </style>
-                <property name="label"></property>
-                <property name="wrap">True</property>
-                <property name="wrap-mode">word-char</property>
-                <property name="xalign">0.0</property>
-                <property name="margin-top">12</property>
-              </object>
-            </child>
-          </object>
-        </child>
-        <child>
-          <object class="AdwPreferencesGroup">
-            <child>
-              <object class="ComponentsPasswordEntryRow" id="passphrase">
-                <property name="title" translatable="yes">Passphrase</property>
-                <signal name="activated" handler="handle_proceed" swapped="yes"/>
-              </object>
-            </child>
-            <child>
-              <object class="ComponentsPasswordEntryRow" id="confirm_passphrase">
-                <property name="title" translatable="yes">Confirm Passphrase</property>
-                <signal name="activated" handler="handle_proceed" swapped="yes"/>
-              </object>
-            </child>
-          </object>
-        </child>
-        <child>
-          <object class="AdwPreferencesGroup">
-            <child>
-              <object class="AdwActionRow" id="file_row">
-                <property name="title">File</property>
-                <property name="subtitle" bind-source="ImportExportKeysSubpage" bind-property="file-path" 
bind-flags="sync-create"/>
+      <object class="GtkScrolledWindow" id="scrolled_window">
+        <property name="hscrollbar-policy">never</property>
+        <property name="propagate-natural-height">True</property>
+        <property name="vexpand">True</property>
+        <property name="child">
+          <object class="AdwClamp">
+            <property name="child">
+              <object class="GtkBox" id="box">
+                <property name="orientation">vertical</property>
                 <child>
-                  <object class="GtkButton" id="file_button">
-                    <property name="label" translatable="yes">Choose…</property>
-                    <property name="valign">center</property>
-                    <signal name="clicked" handler="handle_choose_file" swapped="yes"/>
+                  <object class="GtkBox">
+                    <style>
+                      <class name="paragraphs"/>
+                    </style>
+                    <property name="orientation">vertical</property>
+                    <child>
+                      <object class="GtkLabel" id="description">
+                        <style>
+                          <class name="large-line-height"/>
+                        </style>
+                        <property name="label"></property>
+                        <property name="wrap">True</property>
+                        <property name="wrap-mode">word-char</property>
+                        <property name="xalign">0.0</property>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="instructions">
+                        <style>
+                          <class name="large-line-height"/>
+                        </style>
+                        <property name="label"></property>
+                        <property name="wrap">True</property>
+                        <property name="wrap-mode">word-char</property>
+                        <property name="xalign">0.0</property>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child>
+                  <object class="GtkListBox">
+                    <style>
+                      <class name="boxed-list"/>
+                    </style>
+                    <child>
+                      <object class="ComponentsPasswordEntryRow" id="passphrase">
+                        <property name="title" translatable="yes">Passphrase</property>
+                        <signal name="activated" handler="handle_proceed" swapped="yes"/>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="ComponentsPasswordEntryRow" id="confirm_passphrase">
+                        <property name="title" translatable="yes">Confirm Passphrase</property>
+                        <signal name="activated" handler="handle_proceed" swapped="yes"/>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child>
+                  <object class="GtkListBox">
+                    <style>
+                      <class name="boxed-list"/>
+                    </style>
+                    <child>
+                      <object class="AdwActionRow" id="file_row">
+                        <property name="title">File</property>
+                        <property name="subtitle" bind-source="ImportExportKeysSubpage" 
bind-property="file-path" bind-flags="sync-create"/>
+                        <child>
+                          <object class="GtkButton" id="file_button">
+                            <property name="label" translatable="yes">Choose…</property>
+                            <property name="valign">center</property>
+                            <signal name="clicked" handler="handle_choose_file" swapped="yes"/>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child>
+                  <object class="SpinnerButton" id="proceed_button">
+                    <style>
+                      <class name="row"/>
+                      <class name="suggested-action"/>
+                    </style>
+                    <property name="sensitive">false</property>
+                    <signal name="clicked" handler="handle_proceed" swapped="yes"/>
                   </object>
                 </child>
               </object>
-            </child>
-          </object>
-        </child>
-        <child>
-          <object class="AdwPreferencesGroup">
-            <child>
-              <object class="SpinnerButton" id="proceed_button">
-                <style>
-                  <class name="row"/>
-                  <class name="suggested-action"/>
-                </style>
-                <property name="sensitive">false</property>
-                <signal name="clicked" handler="handle_proceed" swapped="yes"/>
-              </object>
-            </child>
+            </property>
           </object>
-        </child>
+        </property>
       </object>
     </child>
   </template>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]