summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtklinkbutton.c39
-rw-r--r--gtk/theme/Adwaita/_common.scss3
-rw-r--r--gtk/theme/Adwaita/gtk-contained-dark.css2
-rw-r--r--gtk/theme/Adwaita/gtk-contained.css2
4 files changed, 9 insertions, 37 deletions
diff --git a/gtk/gtklinkbutton.c b/gtk/gtklinkbutton.c
index 67bc56a04b..01177f5c70 100644
--- a/gtk/gtklinkbutton.c
+++ b/gtk/gtklinkbutton.c
@@ -97,8 +97,6 @@ static void gtk_link_button_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec);
-static void gtk_link_button_add (GtkContainer *container,
- GtkWidget *widget);
static gboolean gtk_link_button_button_press (GtkWidget *widget,
GdkEventButton *event);
static void gtk_link_button_clicked (GtkButton *button);
@@ -138,18 +136,15 @@ gtk_link_button_class_init (GtkLinkButtonClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
GtkButtonClass *button_class = GTK_BUTTON_CLASS (klass);
-
+
gobject_class->set_property = gtk_link_button_set_property;
gobject_class->get_property = gtk_link_button_get_property;
gobject_class->finalize = gtk_link_button_finalize;
-
+
widget_class->button_press_event = gtk_link_button_button_press;
widget_class->popup_menu = gtk_link_button_popup_menu;
widget_class->unrealize = gtk_link_button_unrealize;
-
- container_class->add = gtk_link_button_add;
button_class->clicked = gtk_link_button_clicked;
@@ -293,36 +288,6 @@ gtk_link_button_set_property (GObject *object,
}
static void
-set_link_underline (GtkLinkButton *link_button)
-{
- GtkWidget *label;
-
- label = gtk_bin_get_child (GTK_BIN (link_button));
- if (GTK_IS_LABEL (label))
- {
- PangoAttrList *attributes;
- PangoAttribute *uline;
-
- uline = pango_attr_underline_new (PANGO_UNDERLINE_SINGLE);
- uline->start_index = 0;
- uline->end_index = G_MAXUINT;
- attributes = pango_attr_list_new ();
- pango_attr_list_insert (attributes, uline);
- gtk_label_set_attributes (GTK_LABEL (label), attributes);
- pango_attr_list_unref (attributes);
- }
-}
-
-static void
-gtk_link_button_add (GtkContainer *container,
- GtkWidget *widget)
-{
- GTK_CONTAINER_CLASS (gtk_link_button_parent_class)->add (container, widget);
-
- set_link_underline (GTK_LINK_BUTTON (container));
-}
-
-static void
set_hand_cursor (GtkWidget *widget,
gboolean show_hand)
{
diff --git a/gtk/theme/Adwaita/_common.scss b/gtk/theme/Adwaita/_common.scss
index e367672c41..fe888c7131 100644
--- a/gtk/theme/Adwaita/_common.scss
+++ b/gtk/theme/Adwaita/_common.scss
@@ -811,6 +811,9 @@ GtkColorButton.button {
//a weird transition which for some reason
//makes borders blink on hover
}
+ & .label {
+ text-decoration-line: underline;
+ }
}
/*****************
diff --git a/gtk/theme/Adwaita/gtk-contained-dark.css b/gtk/theme/Adwaita/gtk-contained-dark.css
index 4e338bb2f0..dac23ce96a 100644
--- a/gtk/theme/Adwaita/gtk-contained-dark.css
+++ b/gtk/theme/Adwaita/gtk-contained-dark.css
@@ -1274,6 +1274,8 @@ GtkColorButton.button, .header-bar GtkColorButton.button.titlebutton,
text-shadow: none; }
.button:link:hover, .button:link:active, .button:link:checked, .button:visited:hover, .button:visited:active, .button:visited:checked {
text-shadow: none; }
+ .button:link .label, .button:visited .label {
+ text-decoration-line: underline; }
/*****************
* GtkSpinButton *
diff --git a/gtk/theme/Adwaita/gtk-contained.css b/gtk/theme/Adwaita/gtk-contained.css
index 1d1a1076c5..dc5cce9342 100644
--- a/gtk/theme/Adwaita/gtk-contained.css
+++ b/gtk/theme/Adwaita/gtk-contained.css
@@ -1274,6 +1274,8 @@ GtkColorButton.button, .header-bar GtkColorButton.button.titlebutton,
text-shadow: none; }
.button:link:hover, .button:link:active, .button:link:checked, .button:visited:hover, .button:visited:active, .button:visited:checked {
text-shadow: none; }
+ .button:link .label, .button:visited .label {
+ text-decoration-line: underline; }
/*****************
* GtkSpinButton *