[gtk/wip/baedert/outline-radius: 1/2] css: Remove outline border radius properties



commit 6eb51d4fd584c4ee7e2e3c3baba999025af711c6
Author: Timm Bäder <mail baedert org>
Date:   Sat Feb 8 20:39:08 2020 +0100

    css: Remove outline border radius properties
    
    These are always set to the same value as the corresponding border
    radius properties. They are also non-standard, so remove them and
    replace them with the border radius properties everywhere.

 gtk/gtkcssanimatedstyle.c         | 16 ----------------
 gtk/gtkcssarrayvalue.c            |  4 ----
 gtk/gtkcssboxesimplprivate.h      |  8 ++++----
 gtk/gtkcssshorthandpropertyimpl.c |  5 -----
 gtk/gtkcssstaticstyle.c           | 20 --------------------
 gtk/gtkcssstyle.c                 |  8 --------
 gtk/gtkcssstyleprivate.h          |  4 ----
 gtk/gtkcssstylepropertyimpl.c     | 25 -------------------------
 gtk/gtkcsstypesprivate.h          |  6 +-----
 gtk/gtkroundedbox.c               | 14 --------------
 gtk/gtkroundedboxprivate.h        |  3 ---
 gtk/theme/Adwaita/_common.scss    |  8 --------
 12 files changed, 5 insertions(+), 116 deletions(-)
---
diff --git a/gtk/gtkcssanimatedstyle.c b/gtk/gtkcssanimatedstyle.c
index 2070e7f7a6..15745f9b9e 100644
--- a/gtk/gtkcssanimatedstyle.c
+++ b/gtk/gtkcssanimatedstyle.c
@@ -348,22 +348,6 @@ gtk_css_animated_style_set_animated_value (GtkCssAnimatedStyle *animated,
       unshare_outline (animated);
       gtk_css_take_value (&style->outline->outline_offset, value);
       break;
-    case GTK_CSS_PROPERTY_OUTLINE_TOP_LEFT_RADIUS:
-      unshare_outline (animated);
-      gtk_css_take_value (&style->outline->outline_top_left_radius, value);
-      break;
-    case GTK_CSS_PROPERTY_OUTLINE_TOP_RIGHT_RADIUS:
-      unshare_outline (animated);
-      gtk_css_take_value (&style->outline->outline_top_right_radius, value);
-      break;
-    case GTK_CSS_PROPERTY_OUTLINE_BOTTOM_RIGHT_RADIUS:
-      unshare_outline (animated);
-      gtk_css_take_value (&style->outline->outline_bottom_right_radius, value);
-      break;
-    case GTK_CSS_PROPERTY_OUTLINE_BOTTOM_LEFT_RADIUS:
-      unshare_outline (animated);
-      gtk_css_take_value (&style->outline->outline_bottom_left_radius, value);
-      break;
     case GTK_CSS_PROPERTY_BACKGROUND_CLIP:
       unshare_background (animated);
       gtk_css_take_value (&style->background->background_clip, value);
diff --git a/gtk/gtkcssarrayvalue.c b/gtk/gtkcssarrayvalue.c
index 515e6bbeae..28bea64088 100644
--- a/gtk/gtkcssarrayvalue.c
+++ b/gtk/gtkcssarrayvalue.c
@@ -271,10 +271,6 @@ gtk_css_value_array_transition (GtkCssValue *start,
     case GTK_CSS_PROPERTY_OUTLINE_STYLE:
     case GTK_CSS_PROPERTY_OUTLINE_WIDTH:
     case GTK_CSS_PROPERTY_OUTLINE_OFFSET:
-    case GTK_CSS_PROPERTY_OUTLINE_TOP_LEFT_RADIUS:
-    case GTK_CSS_PROPERTY_OUTLINE_TOP_RIGHT_RADIUS:
-    case GTK_CSS_PROPERTY_OUTLINE_BOTTOM_RIGHT_RADIUS:
-    case GTK_CSS_PROPERTY_OUTLINE_BOTTOM_LEFT_RADIUS:
     case GTK_CSS_PROPERTY_BORDER_TOP_COLOR:
     case GTK_CSS_PROPERTY_BORDER_RIGHT_COLOR:
     case GTK_CSS_PROPERTY_BORDER_BOTTOM_COLOR:
diff --git a/gtk/gtkcssboxesimplprivate.h b/gtk/gtkcssboxesimplprivate.h
index 65737e81f8..242ff5880c 100644
--- a/gtk/gtkcssboxesimplprivate.h
+++ b/gtk/gtkcssboxesimplprivate.h
@@ -477,10 +477,10 @@ gtk_css_boxes_compute_outline_box (GtkCssBoxes *boxes)
   gtk_css_boxes_compute_outline_rect (boxes);
 
   gtk_css_boxes_apply_border_radius (&boxes->box[GTK_CSS_AREA_OUTLINE_BOX],
-                                     boxes->style->outline->outline_top_left_radius,
-                                     boxes->style->outline->outline_top_right_radius,
-                                     boxes->style->outline->outline_bottom_right_radius,
-                                     boxes->style->outline->outline_bottom_left_radius);
+                                     boxes->style->border->border_top_left_radius,
+                                     boxes->style->border->border_top_right_radius,
+                                     boxes->style->border->border_bottom_right_radius,
+                                     boxes->style->border->border_bottom_left_radius);
 
   boxes->has_box[GTK_CSS_AREA_OUTLINE_BOX] = TRUE;
 }
diff --git a/gtk/gtkcssshorthandpropertyimpl.c b/gtk/gtkcssshorthandpropertyimpl.c
index 2b524d5256..82b5893151 100644
--- a/gtk/gtkcssshorthandpropertyimpl.c
+++ b/gtk/gtkcssshorthandpropertyimpl.c
@@ -1132,8 +1132,6 @@ _gtk_css_shorthand_property_init_properties (void)
                                          "border-top-color", "border-right-color", "border-bottom-color", 
"border-left-color",
                                          "border-image-source", "border-image-slice", "border-image-width", 
"border-image-repeat", NULL };
   const char *outline_subproperties[] = { "outline-width", "outline-style", "outline-color", NULL };
-  const char *outline_radius_subproperties[] = { "-gtk-outline-top-left-radius", 
"-gtk-outline-top-right-radius",
-                                                 "-gtk-outline-bottom-right-radius", 
"-gtk-outline-bottom-left-radius", NULL };
   const char *background_subproperties[] = { "background-image", "background-position", "background-size", 
"background-repeat", "background-clip", "background-origin",
                                              "background-color", NULL };
   const char *transition_subproperties[] = { "transition-property", "transition-duration", 
"transition-delay", "transition-timing-function", NULL };
@@ -1183,9 +1181,6 @@ _gtk_css_shorthand_property_init_properties (void)
   gtk_css_shorthand_property_register   ("border",
                                          border_subproperties,
                                          parse_border);
-  gtk_css_shorthand_property_register   ("-gtk-outline-radius",
-                                         outline_radius_subproperties,
-                                         parse_border_radius);
   gtk_css_shorthand_property_register   ("outline",
                                          outline_subproperties,
                                          parse_border_side);
diff --git a/gtk/gtkcssstaticstyle.c b/gtk/gtkcssstaticstyle.c
index 5a9336ce79..fee5c01e56 100644
--- a/gtk/gtkcssstaticstyle.c
+++ b/gtk/gtkcssstaticstyle.c
@@ -99,10 +99,6 @@ static const int outline_props[] = {
   GTK_CSS_PROPERTY_OUTLINE_STYLE,
   GTK_CSS_PROPERTY_OUTLINE_WIDTH,
   GTK_CSS_PROPERTY_OUTLINE_OFFSET,
-  GTK_CSS_PROPERTY_OUTLINE_TOP_LEFT_RADIUS,
-  GTK_CSS_PROPERTY_OUTLINE_TOP_RIGHT_RADIUS,
-  GTK_CSS_PROPERTY_OUTLINE_BOTTOM_RIGHT_RADIUS,
-  GTK_CSS_PROPERTY_OUTLINE_BOTTOM_LEFT_RADIUS,
   GTK_CSS_PROPERTY_OUTLINE_COLOR,
 };
 
@@ -529,18 +525,6 @@ gtk_css_static_style_set_value (GtkCssStaticStyle *sstyle,
     case GTK_CSS_PROPERTY_OUTLINE_OFFSET:
       gtk_css_take_value (&style->outline->outline_offset, value);
       break;
-    case GTK_CSS_PROPERTY_OUTLINE_TOP_LEFT_RADIUS:
-      gtk_css_take_value (&style->outline->outline_top_left_radius, value);
-      break;
-    case GTK_CSS_PROPERTY_OUTLINE_TOP_RIGHT_RADIUS:
-      gtk_css_take_value (&style->outline->outline_top_right_radius, value);
-      break;
-    case GTK_CSS_PROPERTY_OUTLINE_BOTTOM_RIGHT_RADIUS:
-      gtk_css_take_value (&style->outline->outline_bottom_right_radius, value);
-      break;
-    case GTK_CSS_PROPERTY_OUTLINE_BOTTOM_LEFT_RADIUS:
-      gtk_css_take_value (&style->outline->outline_bottom_left_radius, value);
-      break;
     case GTK_CSS_PROPERTY_BACKGROUND_CLIP:
       gtk_css_take_value (&style->background->background_clip, value);
       break;
@@ -795,10 +779,6 @@ gtk_css_outline_create_initial_values (void)
   values->outline_style = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_OUTLINE_STYLE, NULL, NULL, 
NULL);
   values->outline_width = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_OUTLINE_WIDTH, NULL, NULL, 
NULL);
   values->outline_offset = _gtk_css_initial_value_new_compute (GTK_CSS_PROPERTY_OUTLINE_OFFSET, NULL, NULL, 
NULL);
-  values->outline_top_left_radius = _gtk_css_initial_value_new_compute 
(GTK_CSS_PROPERTY_OUTLINE_TOP_LEFT_RADIUS, NULL, NULL, NULL);
-  values->outline_top_right_radius = _gtk_css_initial_value_new_compute 
(GTK_CSS_PROPERTY_OUTLINE_TOP_RIGHT_RADIUS, NULL, NULL, NULL);
-  values->outline_bottom_right_radius = _gtk_css_initial_value_new_compute 
(GTK_CSS_PROPERTY_OUTLINE_BOTTOM_RIGHT_RADIUS, NULL, NULL, NULL);
-  values->outline_bottom_left_radius = _gtk_css_initial_value_new_compute 
(GTK_CSS_PROPERTY_OUTLINE_BOTTOM_LEFT_RADIUS, NULL, NULL, NULL);
   values->outline_color = NULL;
 
   return (GtkCssValues *)values;
diff --git a/gtk/gtkcssstyle.c b/gtk/gtkcssstyle.c
index 24e1b5225c..d303fdecdd 100644
--- a/gtk/gtkcssstyle.c
+++ b/gtk/gtkcssstyle.c
@@ -189,14 +189,6 @@ gtk_css_style_get_value (GtkCssStyle *style,
       return style->outline->outline_width;
     case GTK_CSS_PROPERTY_OUTLINE_OFFSET:
       return style->outline->outline_offset;
-    case GTK_CSS_PROPERTY_OUTLINE_TOP_LEFT_RADIUS:
-      return style->outline->outline_top_left_radius;
-    case GTK_CSS_PROPERTY_OUTLINE_TOP_RIGHT_RADIUS:
-      return style->outline->outline_top_right_radius;
-    case GTK_CSS_PROPERTY_OUTLINE_BOTTOM_RIGHT_RADIUS:
-      return style->outline->outline_bottom_right_radius;
-    case GTK_CSS_PROPERTY_OUTLINE_BOTTOM_LEFT_RADIUS:
-      return style->outline->outline_bottom_left_radius;
     case GTK_CSS_PROPERTY_BACKGROUND_CLIP:
       return style->background->background_clip;
     case GTK_CSS_PROPERTY_BACKGROUND_ORIGIN:
diff --git a/gtk/gtkcssstyleprivate.h b/gtk/gtkcssstyleprivate.h
index 8cf069c98d..3db7eb150b 100644
--- a/gtk/gtkcssstyleprivate.h
+++ b/gtk/gtkcssstyleprivate.h
@@ -137,10 +137,6 @@ struct _GtkCssOutlineValues {
   GtkCssValue *outline_style;
   GtkCssValue *outline_width;
   GtkCssValue *outline_offset;
-  GtkCssValue *outline_top_left_radius;
-  GtkCssValue *outline_top_right_radius;
-  GtkCssValue *outline_bottom_right_radius;
-  GtkCssValue *outline_bottom_left_radius;
   GtkCssValue *outline_color;
 };
 
diff --git a/gtk/gtkcssstylepropertyimpl.c b/gtk/gtkcssstylepropertyimpl.c
index 27bada82a8..2e82a39820 100644
--- a/gtk/gtkcssstylepropertyimpl.c
+++ b/gtk/gtkcssstylepropertyimpl.c
@@ -1105,31 +1105,6 @@ _gtk_css_style_property_init_properties (void)
                                           outline_parse,
                                           _gtk_css_number_value_new (0.0, GTK_CSS_PX));
 
-  gtk_css_style_property_register        ("-gtk-outline-top-left-radius",
-                                          GTK_CSS_PROPERTY_OUTLINE_TOP_LEFT_RADIUS,
-                                          GTK_STYLE_PROPERTY_ANIMATED,
-                                          GTK_CSS_AFFECTS_OUTLINE,
-                                          border_corner_radius_value_parse,
-                                          _gtk_css_number_value_new (0, GTK_CSS_PX));
-  gtk_css_style_property_register        ("-gtk-outline-top-right-radius",
-                                          GTK_CSS_PROPERTY_OUTLINE_TOP_RIGHT_RADIUS,
-                                          GTK_STYLE_PROPERTY_ANIMATED,
-                                          GTK_CSS_AFFECTS_OUTLINE,
-                                          border_corner_radius_value_parse,
-                                          _gtk_css_number_value_new (0, GTK_CSS_PX));
-  gtk_css_style_property_register        ("-gtk-outline-bottom-right-radius",
-                                          GTK_CSS_PROPERTY_OUTLINE_BOTTOM_RIGHT_RADIUS,
-                                          GTK_STYLE_PROPERTY_ANIMATED,
-                                          GTK_CSS_AFFECTS_OUTLINE,
-                                          border_corner_radius_value_parse,
-                                          _gtk_css_number_value_new (0, GTK_CSS_PX));
-  gtk_css_style_property_register        ("-gtk-outline-bottom-left-radius",
-                                          GTK_CSS_PROPERTY_OUTLINE_BOTTOM_LEFT_RADIUS,
-                                          GTK_STYLE_PROPERTY_ANIMATED,
-                                          GTK_CSS_AFFECTS_OUTLINE,
-                                          border_corner_radius_value_parse,
-                                          _gtk_css_number_value_new (0, GTK_CSS_PX));
-
   gtk_css_style_property_register        ("background-clip",
                                           GTK_CSS_PROPERTY_BACKGROUND_CLIP,
                                           0,
diff --git a/gtk/gtkcsstypesprivate.h b/gtk/gtkcsstypesprivate.h
index 1e18fac297..16d4e61f66 100644
--- a/gtk/gtkcsstypesprivate.h
+++ b/gtk/gtkcsstypesprivate.h
@@ -43,7 +43,7 @@ typedef struct _GtkCssStaticStyle GtkCssStaticStyle;
 #define GTK_CSS_CHANGE_BACKDROP                       (1ULL << 10)
 #define GTK_CSS_CHANGE_SELECTED                       (1ULL << 11)
 
-#define GTK_CSS_CHANGE_SIBLING_SHIFT 12 
+#define GTK_CSS_CHANGE_SIBLING_SHIFT 12
 
 #define GTK_CSS_CHANGE_SIBLING_CLASS                  (1ULL << 12)
 #define GTK_CSS_CHANGE_SIBLING_NAME                   (1ULL << 13)
@@ -231,10 +231,6 @@ enum { /*< skip >*/
   GTK_CSS_PROPERTY_OUTLINE_STYLE,
   GTK_CSS_PROPERTY_OUTLINE_WIDTH,
   GTK_CSS_PROPERTY_OUTLINE_OFFSET,
-  GTK_CSS_PROPERTY_OUTLINE_TOP_LEFT_RADIUS,
-  GTK_CSS_PROPERTY_OUTLINE_TOP_RIGHT_RADIUS,
-  GTK_CSS_PROPERTY_OUTLINE_BOTTOM_RIGHT_RADIUS,
-  GTK_CSS_PROPERTY_OUTLINE_BOTTOM_LEFT_RADIUS,
   GTK_CSS_PROPERTY_BACKGROUND_CLIP,
   GTK_CSS_PROPERTY_BACKGROUND_ORIGIN,
   GTK_CSS_PROPERTY_BACKGROUND_SIZE,
diff --git a/gtk/gtkroundedbox.c b/gtk/gtkroundedbox.c
index ee0c3e6339..801c88c6a3 100644
--- a/gtk/gtkroundedbox.c
+++ b/gtk/gtkroundedbox.c
@@ -159,20 +159,6 @@ gtk_rounded_boxes_init_for_style (GskRoundedRect *border_box,
     }
 }
 
-void
-_gtk_rounded_box_apply_outline_radius_for_style (GskRoundedRect   *box,
-                                                 GtkCssStyle      *style)
-{
-  const GtkCssValue *corner[4];
-
-  corner[GSK_CORNER_TOP_LEFT] = style->outline->outline_top_left_radius;
-  corner[GSK_CORNER_TOP_RIGHT] = style->outline->outline_top_right_radius;
-  corner[GSK_CORNER_BOTTOM_LEFT] = style->outline->outline_bottom_left_radius;
-  corner[GSK_CORNER_BOTTOM_RIGHT] = style->outline->outline_bottom_right_radius;
-
-  _gtk_rounded_box_apply_border_radius (box, corner);
-}
-
 typedef struct {
   double angle1;
   double angle2;
diff --git a/gtk/gtkroundedboxprivate.h b/gtk/gtkroundedboxprivate.h
index 4f9c0a1697..4bf2c2fb72 100644
--- a/gtk/gtkroundedboxprivate.h
+++ b/gtk/gtkroundedboxprivate.h
@@ -42,9 +42,6 @@ void            gtk_rounded_boxes_init_for_style                (GskRoundedRect
                                                                  double                  width,
                                                                  double                  height);
 
-void            _gtk_rounded_box_apply_outline_radius_for_style (GskRoundedRect         *box,
-                                                                 GtkCssStyle            *style);
-
 double          _gtk_rounded_box_guess_length                   (const GskRoundedRect   *box,
                                                                  GtkCssSide              side);
 
diff --git a/gtk/theme/Adwaita/_common.scss b/gtk/theme/Adwaita/_common.scss
index a1f1a66545..6f12535e86 100644
--- a/gtk/theme/Adwaita/_common.scss
+++ b/gtk/theme/Adwaita/_common.scss
@@ -27,7 +27,6 @@ flowboxchild:focus(visible) {
   outline-style: dashed;
   outline-offset: -3px;
   outline-width: 1px;
-  -gtk-outline-radius: $button-radius - 2;
 }
 
 
@@ -831,7 +830,6 @@ button {
 
   &.circular { // The Bloody Circul Button
     border-radius: 9999px;
-    -gtk-outline-radius: 9999px;
 
     label { padding: 0; }
   }
@@ -2609,7 +2607,6 @@ scale {
     > trough > highlight,
     > trough {
       border-radius: 5px;
-      -gtk-outline-radius: 7px;
     }
   }
 
@@ -2618,7 +2615,6 @@ scale {
     @extend %scale_trough;
 
     outline-offset: 2px;
-    -gtk-outline-radius: 5px;
   }
 
   // the colored part of the backing bit
@@ -3467,12 +3463,10 @@ messagedialog { // Message Dialog styling
       &:first-child{
         border-left-style: none;
         border-bottom-left-radius: 7px;
-        -gtk-outline-bottom-left-radius: 5px;
       }
 
       &:last-child {
         border-bottom-right-radius: 7px;
-        -gtk-outline-bottom-right-radius: 5px;
       }
     }
   }
@@ -3613,7 +3607,6 @@ placessidebar {
       margin-bottom: 3px;
       padding: 0;
       border-radius: 100%;
-      -gtk-outline-radius: 100%;
 
       &:not(:hover):not(:active),
       &:backdrop { > image { opacity: $_placesidebar_icons_opacity; }}
@@ -4099,7 +4092,6 @@ button.titlebutton {
 
   &:not(.menu) {
     border-radius: 9999px;
-    -gtk-outline-radius: 9999px;
     padding: 6px;
     margin: 0 2px;
     min-width: 0;


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