[libadwaita/wip/exalm/error-warning-success: 91/92] a




commit 530b4884ad46d81852592604d54db1df5f68b730
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Mon Nov 15 22:46:44 2021 +0500

    a

 demo/adw-style-demo-window.ui        | 103 ++++++++++++++++++++++++++++-------
 src/stylesheet/_colors.scss          |   8 +++
 src/stylesheet/_defaults.scss        |  16 ++++--
 src/stylesheet/widgets/_entries.scss |   9 +--
 src/stylesheet/widgets/_labels.scss  |  16 ++++--
 5 files changed, 118 insertions(+), 34 deletions(-)
---
diff --git a/demo/adw-style-demo-window.ui b/demo/adw-style-demo-window.ui
index 9929264a..584a6f0f 100644
--- a/demo/adw-style-demo-window.ui
+++ b/demo/adw-style-demo-window.ui
@@ -307,33 +307,74 @@ The "opaque" style class allows to create buttons with custom colors that look s
                   <object class="AdwPreferencesGroup">
                     <property name="title" translatable="yes">Entries</property>
                     <child>
-                      <object class="GtkBox">
-                        <property name="spacing">6</property>
-                        <property name="homogeneous">True</property>
+                      <object class="GtkFlowBox">
+                        <property name="min-children-per-line">1</property>
+                        <property name="max-children-per-line">3</property>
+                        <property name="column-spacing">6</property>
+                        <property name="row-spacing">6</property>
+                        <property name="selection-mode">none</property>
+                        <property name="margin-top">12</property>
+                        <style>
+                          <class name="inline"/>
+                        </style>
                         <child>
-                          <object class="GtkEntry">
-                            <property name="placeholder-text" translatable="yes">Regular</property>
-                            <property name="text" translatable="yes">Regular</property>
+                          <object class="GtkFlowBoxChild">
+                            <property name="focusable">False</property>
+                            <child>
+                              <object class="GtkEntry">
+                                <property name="placeholder-text" translatable="yes">Regular</property>
+                                <property name="text" translatable="yes">Regular</property>
+                                <property name="secondary-icon-name">edit-copy-symbolic</property>
+                              </object>
+                            </child>
                           </object>
                         </child>
                         <child>
-                          <object class="GtkEntry">
-                            <property name="placeholder-text" translatable="yes">Warning</property>
-                            <property name="text" translatable="yes">Warning</property>
-                            <property name="tooltip-text">warning</property>
-                            <style>
-                              <class name="warning"/>
-                            </style>
+                          <object class="GtkFlowBoxChild">
+                            <property name="focusable">False</property>
+                            <child>
+                              <object class="GtkEntry">
+                                <property name="placeholder-text" translatable="yes">Success</property>
+                                <property name="text" translatable="yes">Success</property>
+                                <property name="tooltip-text">success</property>
+                                <property name="secondary-icon-name">edit-copy-symbolic</property>
+                                <style>
+                                  <class name="success"/>
+                                </style>
+                              </object>
+                            </child>
                           </object>
                         </child>
                         <child>
-                          <object class="GtkEntry">
-                            <property name="placeholder-text" translatable="yes">Error</property>
-                            <property name="text" translatable="yes">Error</property>
-                            <property name="tooltip-text">error</property>
-                            <style>
-                              <class name="error"/>
-                            </style>
+                          <object class="GtkFlowBoxChild">
+                            <property name="focusable">False</property>
+                            <child>
+                              <object class="GtkEntry">
+                                <property name="placeholder-text" translatable="yes">Warning</property>
+                                <property name="text" translatable="yes">Warning</property>
+                                <property name="tooltip-text">warning</property>
+                                <property name="secondary-icon-name">edit-copy-symbolic</property>
+                                <style>
+                                  <class name="warning"/>
+                                </style>
+                              </object>
+                            </child>
+                          </object>
+                        </child>
+                        <child>
+                          <object class="GtkFlowBoxChild">
+                            <property name="focusable">False</property>
+                            <child>
+                              <object class="GtkEntry">
+                                <property name="placeholder-text" translatable="yes">Error</property>
+                                <property name="text" translatable="yes">Error</property>
+                                <property name="tooltip-text">error</property>
+                                <property name="secondary-icon-name">edit-copy-symbolic</property>
+                                <style>
+                                  <class name="error"/>
+                                </style>
+                              </object>
+                            </child>
                           </object>
                         </child>
                       </object>
@@ -559,6 +600,28 @@ The "opaque" style class allows to create buttons with custom colors that look s
                                     </style>
                                   </object>
                                 </child>
+                                <child>
+                                  <object class="GtkLabel">
+                                    <property name="label" translatable="yes">Success</property>
+                                    <property name="xalign">0</property>
+                                    <property name="ellipsize">end</property>
+                                    <property name="tooltip-text">error</property>
+                                    <style>
+                                      <class name="success"/>
+                                    </style>
+                                  </object>
+                                </child>
+                                <child>
+                                  <object class="GtkLabel">
+                                    <property name="label" translatable="yes">Warning</property>
+                                    <property name="xalign">0</property>
+                                    <property name="ellipsize">end</property>
+                                    <property name="tooltip-text">error</property>
+                                    <style>
+                                      <class name="warning"/>
+                                    </style>
+                                  </object>
+                                </child>
                                 <child>
                                   <object class="GtkLabel">
                                     <property name="label" translatable="yes">Error</property>
diff --git a/src/stylesheet/_colors.scss b/src/stylesheet/_colors.scss
index 6ff2eb86..14a54a75 100644
--- a/src/stylesheet/_colors.scss
+++ b/src/stylesheet/_colors.scss
@@ -13,8 +13,16 @@ $destructive_bg_color: gtkcolor(destructive_bg_color);
 $destructive_fg_color: gtkcolor(destructive_fg_color);
 $destructive_color: gtkcolor(destructive_color);
 
+$success_bg_color: gtkcolor(success_bg_color);
+$success_fg_color: gtkcolor(success_fg_color);
 $success_color: gtkcolor(success_color);
+
+$warning_bg_color: gtkcolor(warning_bg_color);
+$warning_fg_color: gtkcolor(warning_fg_color);
 $warning_color: gtkcolor(warning_color);
+
+$error_bg_color: gtkcolor(error_bg_color);
+$error_fg_color: gtkcolor(error_fg_color);
 $error_color: gtkcolor(error_color);
 
 $window_bg_color: gtkcolor(window_bg_color);
diff --git a/src/stylesheet/_defaults.scss b/src/stylesheet/_defaults.scss
index 5256ffe3..4ecffd92 100644
--- a/src/stylesheet/_defaults.scss
+++ b/src/stylesheet/_defaults.scss
@@ -16,12 +16,20 @@
 // destructive-action buttons
 @define-color destructive_bg_color @red_3;
 @define-color destructive_fg_color @light_1;
-@define-color destructive_color #{if($variant == 'dark', "@red_1", "@red_4")};
+@define-color destructive_color #{if($variant == 'dark', #ff7b63, "@red_4")};
 
 // Levelbars, entries, labels and infobars. These don't need text colors
-@define-color success_color @green_3;
-@define-color warning_color @yellow_5;
-@define-color error_color @red_3;
+@define-color success_bg_color @green_3;
+@define-color success_fg_color @light_1;
+@define-color success_color #{if($variant == 'dark', "@green_1", "@green_5")};
+
+@define-color warning_bg_color @yellow_5;
+@define-color warning_fg_color @light_1;
+@define-color warning_color #{if($variant == 'dark', "@yellow_2", "@orange_5")};
+
+@define-color error_bg_color @red_2;
+@define-color error_fg_color @light_1;
+@define-color error_color #{if($variant == 'dark', #ff7b63, "@red_4")};
 
 // Window
 @define-color window_bg_color #{if($variant == 'light', #fafafa, #242424)};
diff --git a/src/stylesheet/widgets/_entries.scss b/src/stylesheet/widgets/_entries.scss
index 12c56a12..ccaa4518 100644
--- a/src/stylesheet/widgets/_entries.scss
+++ b/src/stylesheet/widgets/_entries.scss
@@ -41,16 +41,13 @@ entry {
     &:disabled { filter: opacity($disabled_opacity); }
 
     // entry error and warning style
-    @each $e_type, $e_color in (error, $error_color),
-                               (warning, $warning_color) {
+    @each $e_type, $e_color in (error,   $error_bg_color),
+                               (warning, $warning_bg_color),
+                               (success, $success_bg_color) {
       &.#{$e_type} {
         @include focus-ring($focus-state: ':focus-within', $fc: gtkalpha($e_color, $focus_border_opacity));
 
-        color: gtkmix($e_color, $view_fg_color, 70%);
-
         > text {
-          color: gtkmix($e_color, $view_fg_color, 70%);
-
           > selection:focus-within { background-color: gtkalpha($e_color, .2); }
 
           > cursor-handle > contents { background-color: $e_color; }
diff --git a/src/stylesheet/widgets/_labels.scss b/src/stylesheet/widgets/_labels.scss
index d518262d..f972f32f 100644
--- a/src/stylesheet/widgets/_labels.scss
+++ b/src/stylesheet/widgets/_labels.scss
@@ -8,10 +8,6 @@ label {
   &:disabled {
     filter: opacity($disabled_opacity);
   }
-
-  &.error {
-   color: $error_color;
-  }
 }
 
 .dim-label {
@@ -22,6 +18,18 @@ label {
   color: $accent_color;
 }
 
+.success {
+  color: $success_color;
+}
+
+.warning {
+  color: $warning_color;
+}
+
+.error {
+  color: $error_color;
+}
+
 /**********************
  * General Typography *
  **********************/


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