[gtk/wip/jimmac/selection-mode-cleanup] adwaita: fix selectionmode checkboxes



commit c7d35bc29641ec5f920628d753933af2a00bf4a2
Author: Jakub Steiner <jimmac gmail com>
Date:   Wed Feb 14 14:42:31 2018 +0100

    adwaita: fix selectionmode checkboxes
    
    - stop usingimage assets
    - FIXME: sadly despite being scalable, the overlay checkmark
      is not rendered to the target 32x32px size, but the 16x16px
      buffer seems to be scaled up.
    
    Fixes issue #28

 gtk/theme/Adwaita/_common.scss           | 25 ++++++++++++-------------
 gtk/theme/Adwaita/gtk-contained-dark.css | 16 ++++++++--------
 gtk/theme/Adwaita/gtk-contained.css      | 16 ++++++++--------
 3 files changed, 28 insertions(+), 29 deletions(-)
---
diff --git a/gtk/theme/Adwaita/_common.scss b/gtk/theme/Adwaita/_common.scss
index 5fd176598b..53a2732411 100644
--- a/gtk/theme/Adwaita/_common.scss
+++ b/gtk/theme/Adwaita/_common.scss
@@ -2720,21 +2720,20 @@ switch {
 
 
 //selection-mode
-@each $s,$as in ('','-selectionmode'),
-                  (':hover', '-hover-selectionmode'),
-                  (':active', '-active-selectionmode'),
-                  (':backdrop', '-backdrop-selectionmode'),
-                  (':checked', '-checked-selectionmode'),
-                  (':checked:hover', '-checked-hover-selectionmode'),
-                  (':checked:active', '-checked-active-selectionmode'),
-                  (':backdrop:checked', '-checked-backdrop-selectionmode') {
+@each $s in  ('',
+              ':hover',
+              ':active',
+              ':backdrop',
+              ':checked',
+              ':checked:hover',
+              ':checked:active',
+              ':backdrop:checked') {
   .view.content-view.check#{$s}:not(list),
   .content-view .tile check#{$s}:not(list) {
-    -gtk-icon-shadow: none;
-    -gtk-icon-source: -gtk-scaled(url("assets/checkbox#{$as}.png"), url("assets/checkbox#{$as}@2.png"));
-    background-color: transparent;
-    min-width: 40px;
-    min-height: 40px;
+    margin: 12px;
+    min-width: 32px; min-height: 32px;
+    background-color: $osd_bg_color;
+    border-radius: 5px;
     background-image: none;
     transition: none;
     box-shadow: none;
diff --git a/gtk/theme/Adwaita/gtk-contained-dark.css b/gtk/theme/Adwaita/gtk-contained-dark.css
index 4b362f5505..a29b4e0487 100644
--- a/gtk/theme/Adwaita/gtk-contained-dark.css
+++ b/gtk/theme/Adwaita/gtk-contained-dark.css
@@ -1102,21 +1102,21 @@ switch:backdrop:disabled slider { border-color: #202425; background-image: image
 switch:backdrop:disabled slider label, switch:backdrop:disabled slider { color: #566164; }
 
 /************************* Check and Radio items * */
-.view.content-view.check:not(list), iconview.content-view.check:not(list), .content-view .tile 
check:not(list) { -gtk-icon-shadow: none; -gtk-icon-source: 
-gtk-scaled(url("assets/checkbox-selectionmode.png"), url("assets/checkbox-selectionmode 2 png")); 
background-color: transparent; min-width: 40px; min-height: 40px; background-image: none; transition: none; 
box-shadow: none; border-width: 0; }
+.view.content-view.check:not(list), iconview.content-view.check:not(list), .content-view .tile 
check:not(list) { margin: 12px; min-width: 32px; min-height: 32px; background-color: rgba(28, 31, 32, 0.7); 
border-radius: 5px; background-image: none; transition: none; box-shadow: none; border-width: 0; }
 
-.view.content-view.check:hover:not(list), iconview.content-view.check:hover:not(list), .content-view .tile 
check:hover:not(list) { -gtk-icon-shadow: none; -gtk-icon-source: 
-gtk-scaled(url("assets/checkbox-hover-selectionmode.png"), url("assets/checkbox-hover-selectionmode 2 
png")); background-color: transparent; min-width: 40px; min-height: 40px; background-image: none; transition: 
none; box-shadow: none; border-width: 0; }
+.view.content-view.check:hover:not(list), iconview.content-view.check:hover:not(list), .content-view .tile 
check:hover:not(list) { margin: 12px; min-width: 32px; min-height: 32px; background-color: rgba(28, 31, 32, 
0.7); border-radius: 5px; background-image: none; transition: none; box-shadow: none; border-width: 0; }
 
-.view.content-view.check:active:not(list), iconview.content-view.check:active:not(list), .content-view .tile 
check:active:not(list) { -gtk-icon-shadow: none; -gtk-icon-source: 
-gtk-scaled(url("assets/checkbox-active-selectionmode.png"), url("assets/checkbox-active-selectionmode 2 
png")); background-color: transparent; min-width: 40px; min-height: 40px; background-image: none; transition: 
none; box-shadow: none; border-width: 0; }
+.view.content-view.check:active:not(list), iconview.content-view.check:active:not(list), .content-view .tile 
check:active:not(list) { margin: 12px; min-width: 32px; min-height: 32px; background-color: rgba(28, 31, 32, 
0.7); border-radius: 5px; background-image: none; transition: none; box-shadow: none; border-width: 0; }
 
-.view.content-view.check:backdrop:not(list), iconview.content-view.check:backdrop:not(list), .content-view 
.tile check:backdrop:not(list) { -gtk-icon-shadow: none; -gtk-icon-source: 
-gtk-scaled(url("assets/checkbox-backdrop-selectionmode.png"), url("assets/checkbox-backdrop-selectionmode 2 
png")); background-color: transparent; min-width: 40px; min-height: 40px; background-image: none; transition: 
none; box-shadow: none; border-width: 0; }
+.view.content-view.check:backdrop:not(list), iconview.content-view.check:backdrop:not(list), .content-view 
.tile check:backdrop:not(list) { margin: 12px; min-width: 32px; min-height: 32px; background-color: rgba(28, 
31, 32, 0.7); border-radius: 5px; background-image: none; transition: none; box-shadow: none; border-width: 
0; }
 
-.view.content-view.check:checked:not(list), iconview.content-view.check:checked:not(list), .content-view 
.tile check:checked:not(list) { -gtk-icon-shadow: none; -gtk-icon-source: 
-gtk-scaled(url("assets/checkbox-checked-selectionmode.png"), url("assets/checkbox-checked-selectionmode 2 
png")); background-color: transparent; min-width: 40px; min-height: 40px; background-image: none; transition: 
none; box-shadow: none; border-width: 0; }
+.view.content-view.check:checked:not(list), iconview.content-view.check:checked:not(list), .content-view 
.tile check:checked:not(list) { margin: 12px; min-width: 32px; min-height: 32px; background-color: rgba(28, 
31, 32, 0.7); border-radius: 5px; background-image: none; transition: none; box-shadow: none; border-width: 
0; }
 
-.view.content-view.check:checked:hover:not(list), iconview.content-view.check:checked:hover:not(list), 
.content-view .tile check:checked:hover:not(list) { -gtk-icon-shadow: none; -gtk-icon-source: 
-gtk-scaled(url("assets/checkbox-checked-hover-selectionmode.png"), 
url("assets/checkbox-checked-hover-selectionmode 2 png")); background-color: transparent; min-width: 40px; 
min-height: 40px; background-image: none; transition: none; box-shadow: none; border-width: 0; }
+.view.content-view.check:checked:hover:not(list), iconview.content-view.check:checked:hover:not(list), 
.content-view .tile check:checked:hover:not(list) { margin: 12px; min-width: 32px; min-height: 32px; 
background-color: rgba(28, 31, 32, 0.7); border-radius: 5px; background-image: none; transition: none; 
box-shadow: none; border-width: 0; }
 
-.view.content-view.check:checked:active:not(list), iconview.content-view.check:checked:active:not(list), 
.content-view .tile check:checked:active:not(list) { -gtk-icon-shadow: none; -gtk-icon-source: 
-gtk-scaled(url("assets/checkbox-checked-active-selectionmode.png"), 
url("assets/checkbox-checked-active-selectionmode 2 png")); background-color: transparent; min-width: 40px; 
min-height: 40px; background-image: none; transition: none; box-shadow: none; border-width: 0; }
+.view.content-view.check:checked:active:not(list), iconview.content-view.check:checked:active:not(list), 
.content-view .tile check:checked:active:not(list) { margin: 12px; min-width: 32px; min-height: 32px; 
background-color: rgba(28, 31, 32, 0.7); border-radius: 5px; background-image: none; transition: none; 
box-shadow: none; border-width: 0; }
 
-.view.content-view.check:backdrop:checked:not(list), iconview.content-view.check:backdrop:checked:not(list), 
.content-view .tile check:backdrop:checked:not(list) { -gtk-icon-shadow: none; -gtk-icon-source: 
-gtk-scaled(url("assets/checkbox-checked-backdrop-selectionmode.png"), 
url("assets/checkbox-checked-backdrop-selectionmode 2 png")); background-color: transparent; min-width: 40px; 
min-height: 40px; background-image: none; transition: none; box-shadow: none; border-width: 0; }
+.view.content-view.check:backdrop:checked:not(list), iconview.content-view.check:backdrop:checked:not(list), 
.content-view .tile check:backdrop:checked:not(list) { margin: 12px; min-width: 32px; min-height: 32px; 
background-color: rgba(28, 31, 32, 0.7); border-radius: 5px; background-image: none; transition: none; 
box-shadow: none; border-width: 0; }
 
 checkbutton.text-button, radiobutton.text-button { padding: 2px 0; outline-offset: 0; }
 
diff --git a/gtk/theme/Adwaita/gtk-contained.css b/gtk/theme/Adwaita/gtk-contained.css
index 67aef82932..25f988bda9 100644
--- a/gtk/theme/Adwaita/gtk-contained.css
+++ b/gtk/theme/Adwaita/gtk-contained.css
@@ -1120,21 +1120,21 @@ row:selected switch slider:dir(ltr) { border-right-color: #b6b6b3; }
 row:selected switch slider:checked, row:selected switch slider { border-color: #184472; }
 
 /************************* Check and Radio items * */
-.view.content-view.check:not(list), iconview.content-view.check:not(list), .content-view .tile 
check:not(list) { -gtk-icon-shadow: none; -gtk-icon-source: 
-gtk-scaled(url("assets/checkbox-selectionmode.png"), url("assets/checkbox-selectionmode 2 png")); 
background-color: transparent; min-width: 40px; min-height: 40px; background-image: none; transition: none; 
box-shadow: none; border-width: 0; }
+.view.content-view.check:not(list), iconview.content-view.check:not(list), .content-view .tile 
check:not(list) { margin: 12px; min-width: 32px; min-height: 32px; background-color: rgba(28, 31, 32, 0.7); 
border-radius: 5px; background-image: none; transition: none; box-shadow: none; border-width: 0; }
 
-.view.content-view.check:hover:not(list), iconview.content-view.check:hover:not(list), .content-view .tile 
check:hover:not(list) { -gtk-icon-shadow: none; -gtk-icon-source: 
-gtk-scaled(url("assets/checkbox-hover-selectionmode.png"), url("assets/checkbox-hover-selectionmode 2 
png")); background-color: transparent; min-width: 40px; min-height: 40px; background-image: none; transition: 
none; box-shadow: none; border-width: 0; }
+.view.content-view.check:hover:not(list), iconview.content-view.check:hover:not(list), .content-view .tile 
check:hover:not(list) { margin: 12px; min-width: 32px; min-height: 32px; background-color: rgba(28, 31, 32, 
0.7); border-radius: 5px; background-image: none; transition: none; box-shadow: none; border-width: 0; }
 
-.view.content-view.check:active:not(list), iconview.content-view.check:active:not(list), .content-view .tile 
check:active:not(list) { -gtk-icon-shadow: none; -gtk-icon-source: 
-gtk-scaled(url("assets/checkbox-active-selectionmode.png"), url("assets/checkbox-active-selectionmode 2 
png")); background-color: transparent; min-width: 40px; min-height: 40px; background-image: none; transition: 
none; box-shadow: none; border-width: 0; }
+.view.content-view.check:active:not(list), iconview.content-view.check:active:not(list), .content-view .tile 
check:active:not(list) { margin: 12px; min-width: 32px; min-height: 32px; background-color: rgba(28, 31, 32, 
0.7); border-radius: 5px; background-image: none; transition: none; box-shadow: none; border-width: 0; }
 
-.view.content-view.check:backdrop:not(list), iconview.content-view.check:backdrop:not(list), .content-view 
.tile check:backdrop:not(list) { -gtk-icon-shadow: none; -gtk-icon-source: 
-gtk-scaled(url("assets/checkbox-backdrop-selectionmode.png"), url("assets/checkbox-backdrop-selectionmode 2 
png")); background-color: transparent; min-width: 40px; min-height: 40px; background-image: none; transition: 
none; box-shadow: none; border-width: 0; }
+.view.content-view.check:backdrop:not(list), iconview.content-view.check:backdrop:not(list), .content-view 
.tile check:backdrop:not(list) { margin: 12px; min-width: 32px; min-height: 32px; background-color: rgba(28, 
31, 32, 0.7); border-radius: 5px; background-image: none; transition: none; box-shadow: none; border-width: 
0; }
 
-.view.content-view.check:checked:not(list), iconview.content-view.check:checked:not(list), .content-view 
.tile check:checked:not(list) { -gtk-icon-shadow: none; -gtk-icon-source: 
-gtk-scaled(url("assets/checkbox-checked-selectionmode.png"), url("assets/checkbox-checked-selectionmode 2 
png")); background-color: transparent; min-width: 40px; min-height: 40px; background-image: none; transition: 
none; box-shadow: none; border-width: 0; }
+.view.content-view.check:checked:not(list), iconview.content-view.check:checked:not(list), .content-view 
.tile check:checked:not(list) { margin: 12px; min-width: 32px; min-height: 32px; background-color: rgba(28, 
31, 32, 0.7); border-radius: 5px; background-image: none; transition: none; box-shadow: none; border-width: 
0; }
 
-.view.content-view.check:checked:hover:not(list), iconview.content-view.check:checked:hover:not(list), 
.content-view .tile check:checked:hover:not(list) { -gtk-icon-shadow: none; -gtk-icon-source: 
-gtk-scaled(url("assets/checkbox-checked-hover-selectionmode.png"), 
url("assets/checkbox-checked-hover-selectionmode 2 png")); background-color: transparent; min-width: 40px; 
min-height: 40px; background-image: none; transition: none; box-shadow: none; border-width: 0; }
+.view.content-view.check:checked:hover:not(list), iconview.content-view.check:checked:hover:not(list), 
.content-view .tile check:checked:hover:not(list) { margin: 12px; min-width: 32px; min-height: 32px; 
background-color: rgba(28, 31, 32, 0.7); border-radius: 5px; background-image: none; transition: none; 
box-shadow: none; border-width: 0; }
 
-.view.content-view.check:checked:active:not(list), iconview.content-view.check:checked:active:not(list), 
.content-view .tile check:checked:active:not(list) { -gtk-icon-shadow: none; -gtk-icon-source: 
-gtk-scaled(url("assets/checkbox-checked-active-selectionmode.png"), 
url("assets/checkbox-checked-active-selectionmode 2 png")); background-color: transparent; min-width: 40px; 
min-height: 40px; background-image: none; transition: none; box-shadow: none; border-width: 0; }
+.view.content-view.check:checked:active:not(list), iconview.content-view.check:checked:active:not(list), 
.content-view .tile check:checked:active:not(list) { margin: 12px; min-width: 32px; min-height: 32px; 
background-color: rgba(28, 31, 32, 0.7); border-radius: 5px; background-image: none; transition: none; 
box-shadow: none; border-width: 0; }
 
-.view.content-view.check:backdrop:checked:not(list), iconview.content-view.check:backdrop:checked:not(list), 
.content-view .tile check:backdrop:checked:not(list) { -gtk-icon-shadow: none; -gtk-icon-source: 
-gtk-scaled(url("assets/checkbox-checked-backdrop-selectionmode.png"), 
url("assets/checkbox-checked-backdrop-selectionmode 2 png")); background-color: transparent; min-width: 40px; 
min-height: 40px; background-image: none; transition: none; box-shadow: none; border-width: 0; }
+.view.content-view.check:backdrop:checked:not(list), iconview.content-view.check:backdrop:checked:not(list), 
.content-view .tile check:backdrop:checked:not(list) { margin: 12px; min-width: 32px; min-height: 32px; 
background-color: rgba(28, 31, 32, 0.7); border-radius: 5px; background-image: none; transition: none; 
box-shadow: none; border-width: 0; }
 
 checkbutton.text-button, radiobutton.text-button { padding: 2px 0; outline-offset: 0; }
 


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