[gnome-taquin/arnaudb/wip/gtk4: 20/43] Fix CSS warning.



commit 4d9131b52321b361931ae9d41bd0d1db1e00e272
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Thu Feb 20 16:32:33 2020 +0100

    Fix CSS warning.

 data/base-window.css     |  4 ++--
 data/new-game-screen.css | 14 +++++++-------
 src/new-game-screen.vala |  5 ++---
 src/taquin-main.vala     |  8 ++++----
 4 files changed, 15 insertions(+), 16 deletions(-)
---
diff --git a/data/base-window.css b/data/base-window.css
index f86bd3e..f702dc4 100644
--- a/data/base-window.css
+++ b/data/base-window.css
@@ -52,10 +52,10 @@
 }
 
 .horizontal.overlayed-list:dir(ltr).needs-padding > scrolledwindow > viewport > list > row {
-  padding-right:calc(160px+1rem); /* width-request of edit_mode_box + a bit */
+  padding-right:calc(160px + 1rem); /* width-request of edit_mode_box + a bit */
 }
 .horizontal.overlayed-list:dir(rtl).needs-padding > scrolledwindow > viewport > list > row {
-  padding-left :calc(160px+1rem); /* width-request of edit_mode_box + a bit */
+  padding-left :calc(160px + 1rem); /* width-request of edit_mode_box + a bit */
 }
 .horizontal.overlayed-list:dir(ltr).needs-padding > .linked-circular {
   margin-right:1.5rem;
diff --git a/data/new-game-screen.css b/data/new-game-screen.css
index f6502cb..87e77ce 100644
--- a/data/new-game-screen.css
+++ b/data/new-game-screen.css
@@ -19,7 +19,7 @@
 .extra-flat-window.flat-window .new-game-screen { padding:0.4rem; }
 
 button.radio-like-toggle,
-button.menubutton-like-combo {
+menubutton.menubutton-like-combo > button.toggle {
   border-radius:15px;
 /*  -gtk-outline-radius:13px;*/
 }
@@ -100,10 +100,10 @@ button.menubutton-like-combo {
 
 /* copying start-game button */
 
-.extra-flat-window button.menubutton-like-combo {
+.extra-flat-window menubutton.menubutton-like-combo > button.toggle {
   min-height:2rem;
 }
-                   button.menubutton-like-combo {
+                   menubutton.menubutton-like-combo > button.toggle {
   min-height:3rem;
   min-width:11rem;
 
@@ -112,13 +112,13 @@ button.menubutton-like-combo {
 
 /* styling */
 
-button.menubutton-like-combo:checked,
-button.menubutton-like-combo:hover {
+menubutton.menubutton-like-combo > button.toggle:checked,
+menubutton.menubutton-like-combo > button.toggle:hover {
   color:#2e3436; /* gtk-contained.css’ theme_fg_color */
 /*  background:-gtk-gradient (radial, center center, 0, center center, 0.5, from(rgba (255, 255, 255, 1)), 
to(rgba (255, 255, 255, 0)));*/
 }
-button.menubutton-like-combo:checked:backdrop,
-button.menubutton-like-combo:hover:backdrop {
+menubutton.menubutton-like-combo > button.toggle:checked:backdrop,
+menubutton.menubutton-like-combo > button.toggle:hover:backdrop {
   color:@theme_unfocused_fg_color;
 /*  background:-gtk-gradient (radial, center center, 0, center center, 0.5, from(rgba (255, 255, 255, 0.3)), 
to(rgba (255, 255, 255, 0)));*/
 }
diff --git a/src/new-game-screen.vala b/src/new-game-screen.vala
index b56a97d..fd2339a 100644
--- a/src/new-game-screen.vala
+++ b/src/new-game-screen.vala
@@ -113,11 +113,10 @@ private class NewGameScreen : Box, AdaptativeWidget
     }
 
     // that is a quite usual menubutton label, so put it here
-    internal static inline string get_size_button_label (int size)
+    internal static inline string get_size_button_label (uint8 size)
     {
         /* Translators: when configuring a new game, button label for the size of the game ("3 × 3", or 4, 
or 5) */
-        return _("Size: %d × %d ▾").printf (size, size);
-     // return _("Size: %hhu × %hhu ▾").printf (size, size));   // TODO uint8
+        return _("Size: %hhu × %hhu").printf (size, size);
     }
 
     /*\
diff --git a/src/taquin-main.vala b/src/taquin-main.vala
index f6f6225..59699a4 100644
--- a/src/taquin-main.vala
+++ b/src/taquin-main.vala
@@ -257,10 +257,10 @@ private class Taquin : Gtk.Application, BaseApplication
         /* New-game screen signals */
         settings.changed ["size"].connect (() => {
             if (!size_changed)
-                update_size_button_label (settings.get_int ("size") /* 2 <= size <= 9 */);
+                update_size_button_label ((uint8) settings.get_int ("size") /* 2 <= size <= 9 */);
             size_changed = false;
         });
-        update_size_button_label (settings.get_int ("size") /* 2 <= size <= 9 */);
+        update_size_button_label ((uint8) settings.get_int ("size") /* 2 <= size <= 9 */);
 
         settings.changed ["theme"].connect (() => {
             if (!theme_changed)
@@ -470,10 +470,10 @@ private class Taquin : Gtk.Application, BaseApplication
     {
         size_changed = true;
         int size = int.parse (((!) variant).get_string ());
-        update_size_button_label (size /* 3 <= size <= 5 */);
+        update_size_button_label ((uint8) size /* 3 <= size <= 5 */);
         settings.set_int ("size", size);
     }
-    private void update_size_button_label (int size)
+    private void update_size_button_label (uint8 size)
     {
         new_game_screen.update_menubutton_label (NewGameScreen.MenuButton.ONE,
                                                  NewGameScreen.get_size_button_label (size));


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