Compare commits
2 Commits
wip/matthi
...
activatabl
Author | SHA1 | Date | |
---|---|---|---|
|
f6532288bc | ||
|
d64f782b28 |
@@ -49,6 +49,7 @@
|
|||||||
#include "gtktypebuiltins.h"
|
#include "gtktypebuiltins.h"
|
||||||
#include "gtkwidgetprivate.h"
|
#include "gtkwidgetprivate.h"
|
||||||
#include "gtkbinlayout.h"
|
#include "gtkbinlayout.h"
|
||||||
|
#include "gtkgestureclick.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SECTION:gtkinfobar
|
* SECTION:gtkinfobar
|
||||||
@@ -162,6 +163,8 @@ typedef struct
|
|||||||
|
|
||||||
gboolean show_close_button;
|
gboolean show_close_button;
|
||||||
GtkMessageType message_type;
|
GtkMessageType message_type;
|
||||||
|
int default_response;
|
||||||
|
gboolean default_response_sensitive;
|
||||||
} GtkInfoBarPrivate;
|
} GtkInfoBarPrivate;
|
||||||
|
|
||||||
typedef struct _ResponseData ResponseData;
|
typedef struct _ResponseData ResponseData;
|
||||||
@@ -468,12 +471,26 @@ close_button_clicked_cb (GtkWidget *button,
|
|||||||
GTK_RESPONSE_CLOSE);
|
GTK_RESPONSE_CLOSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
click_released_cb (GtkGestureClick *gesture,
|
||||||
|
guint n_press,
|
||||||
|
gdouble x,
|
||||||
|
gdouble y,
|
||||||
|
GtkInfoBar *info_bar)
|
||||||
|
{
|
||||||
|
GtkInfoBarPrivate *priv = gtk_info_bar_get_instance_private (info_bar);
|
||||||
|
|
||||||
|
if (priv->default_response && priv->default_response_sensitive)
|
||||||
|
gtk_info_bar_response (info_bar, priv->default_response);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_info_bar_init (GtkInfoBar *info_bar)
|
gtk_info_bar_init (GtkInfoBar *info_bar)
|
||||||
{
|
{
|
||||||
GtkInfoBarPrivate *priv = gtk_info_bar_get_instance_private (info_bar);
|
GtkInfoBarPrivate *priv = gtk_info_bar_get_instance_private (info_bar);
|
||||||
GtkWidget *widget = GTK_WIDGET (info_bar);
|
GtkWidget *widget = GTK_WIDGET (info_bar);
|
||||||
GtkWidget *main_box;
|
GtkWidget *main_box;
|
||||||
|
GtkGesture *gesture;
|
||||||
|
|
||||||
/* message-type is a CONSTRUCT property, so we init to a value
|
/* message-type is a CONSTRUCT property, so we init to a value
|
||||||
* different from its default to trigger its property setter
|
* different from its default to trigger its property setter
|
||||||
@@ -503,6 +520,11 @@ gtk_info_bar_init (GtkInfoBar *info_bar)
|
|||||||
gtk_container_add (GTK_CONTAINER (main_box), priv->close_button);
|
gtk_container_add (GTK_CONTAINER (main_box), priv->close_button);
|
||||||
g_signal_connect (priv->close_button, "clicked",
|
g_signal_connect (priv->close_button, "clicked",
|
||||||
G_CALLBACK (close_button_clicked_cb), info_bar);
|
G_CALLBACK (close_button_clicked_cb), info_bar);
|
||||||
|
|
||||||
|
gesture = gtk_gesture_click_new ();
|
||||||
|
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), GDK_BUTTON_PRIMARY);
|
||||||
|
g_signal_connect (gesture, "released", G_CALLBACK (click_released_cb), widget);
|
||||||
|
gtk_widget_add_controller (widget, GTK_EVENT_CONTROLLER (gesture));
|
||||||
}
|
}
|
||||||
|
|
||||||
static GtkBuildableIface *parent_buildable_iface;
|
static GtkBuildableIface *parent_buildable_iface;
|
||||||
@@ -754,6 +776,22 @@ gtk_info_bar_new_with_buttons (const gchar *first_button_text,
|
|||||||
return GTK_WIDGET (info_bar);
|
return GTK_WIDGET (info_bar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
update_default_response (GtkInfoBar *info_bar,
|
||||||
|
int response_id,
|
||||||
|
gboolean sensitive)
|
||||||
|
{
|
||||||
|
GtkInfoBarPrivate *priv = gtk_info_bar_get_instance_private (info_bar);
|
||||||
|
|
||||||
|
priv->default_response = response_id;
|
||||||
|
priv->default_response_sensitive = sensitive;
|
||||||
|
|
||||||
|
if (response_id && sensitive)
|
||||||
|
gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (info_bar)), "action");
|
||||||
|
else
|
||||||
|
gtk_style_context_remove_class (gtk_widget_get_style_context (GTK_WIDGET (info_bar)), "action");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gtk_info_bar_set_response_sensitive:
|
* gtk_info_bar_set_response_sensitive:
|
||||||
* @info_bar: a #GtkInfoBar
|
* @info_bar: a #GtkInfoBar
|
||||||
@@ -786,6 +824,9 @@ gtk_info_bar_set_response_sensitive (GtkInfoBar *info_bar,
|
|||||||
}
|
}
|
||||||
|
|
||||||
g_list_free (children);
|
g_list_free (children);
|
||||||
|
|
||||||
|
if (response_id == priv->default_response)
|
||||||
|
update_default_response (info_bar, response_id, setting);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -806,6 +847,7 @@ gtk_info_bar_set_default_response (GtkInfoBar *info_bar,
|
|||||||
{
|
{
|
||||||
GtkInfoBarPrivate *priv = gtk_info_bar_get_instance_private (info_bar);
|
GtkInfoBarPrivate *priv = gtk_info_bar_get_instance_private (info_bar);
|
||||||
GList *children, *list;
|
GList *children, *list;
|
||||||
|
gboolean sensitive = TRUE;
|
||||||
|
|
||||||
g_return_if_fail (GTK_IS_INFO_BAR (info_bar));
|
g_return_if_fail (GTK_IS_INFO_BAR (info_bar));
|
||||||
|
|
||||||
@@ -822,10 +864,13 @@ gtk_info_bar_set_default_response (GtkInfoBar *info_bar,
|
|||||||
|
|
||||||
window = gtk_widget_get_ancestor (GTK_WIDGET (info_bar), GTK_TYPE_WINDOW);
|
window = gtk_widget_get_ancestor (GTK_WIDGET (info_bar), GTK_TYPE_WINDOW);
|
||||||
gtk_window_set_default_widget (GTK_WINDOW (window), widget);
|
gtk_window_set_default_widget (GTK_WINDOW (window), widget);
|
||||||
|
sensitive = gtk_widget_get_sensitive (widget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g_list_free (children);
|
g_list_free (children);
|
||||||
|
|
||||||
|
update_default_response (info_bar, response_id, sensitive);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -4270,6 +4270,11 @@ video {
|
|||||||
infobar {
|
infobar {
|
||||||
border-style: none;
|
border-style: none;
|
||||||
|
|
||||||
|
&.action:hover {
|
||||||
|
background-color: if($variant == 'light', desaturate(lighten(invert($selected_bg_color), 47%), 30%),
|
||||||
|
desaturate(darken(invert($selected_bg_color), 42%), 70%));
|
||||||
|
border-color: lighten($borders_color, 10%);
|
||||||
|
}
|
||||||
&.info,
|
&.info,
|
||||||
&.question,
|
&.question,
|
||||||
&.warning,
|
&.warning,
|
||||||
@@ -4284,7 +4289,6 @@ infobar {
|
|||||||
text-shadow: none;
|
text-shadow: none;
|
||||||
|
|
||||||
&:backdrop { text-shadow: none; }
|
&:backdrop { text-shadow: none; }
|
||||||
|
|
||||||
> revealer > box {
|
> revealer > box {
|
||||||
padding-top: 8px; padding-bottom: 8px;
|
padding-top: 8px; padding-bottom: 8px;
|
||||||
border-bottom: 1px solid lighten($borders_color, 5%);
|
border-bottom: 1px solid lighten($borders_color, 5%);
|
||||||
|
@@ -41,6 +41,8 @@ image.drag-icon { -gtk-icon-size: 32px; }
|
|||||||
|
|
||||||
textview { outline: none; }
|
textview { outline: none; }
|
||||||
|
|
||||||
|
textview:drop(active) { caret-color: #4e9a06; }
|
||||||
|
|
||||||
textview border { background-color: #313131; }
|
textview border { background-color: #313131; }
|
||||||
|
|
||||||
.rubberband, rubberband, flowbox rubberband, treeview.view rubberband, .content-view rubberband, .content-view .rubberband { border: 1px solid #0f3b71; background-color: rgba(15, 59, 113, 0.2); }
|
.rubberband, rubberband, flowbox rubberband, treeview.view rubberband, .content-view rubberband, .content-view .rubberband { border: 1px solid #0f3b71; background-color: rgba(15, 59, 113, 0.2); }
|
||||||
@@ -1541,11 +1543,13 @@ scrolledwindow overshoot.right { background-image: radial-gradient(farthest-side
|
|||||||
|
|
||||||
scrolledwindow overshoot.right:backdrop { background-image: radial-gradient(farthest-side at right, #202020 85%, rgba(32, 32, 32, 0)); background-size: 3% 100%; background-repeat: no-repeat; background-position: right; background-color: transparent; border: none; box-shadow: none; }
|
scrolledwindow overshoot.right:backdrop { background-image: radial-gradient(farthest-side at right, #202020 85%, rgba(32, 32, 32, 0)); background-size: 3% 100%; background-repeat: no-repeat; background-position: right; background-color: transparent; border: none; box-shadow: none; }
|
||||||
|
|
||||||
scrolledwindow junction { border-color: transparent; border-image: linear-gradient(to bottom, #1b1b1b 1px, transparent 1px) 0 0 0 1/0 1px stretch; background-color: #313131; }
|
scrolledwindow junction { background: #1b1b1b, linear-gradient(to bottom, transparent 1px, #313131 1px), linear-gradient(to right, transparent 1px, #313131 1px); }
|
||||||
|
|
||||||
scrolledwindow junction:dir(rtl) { border-image-slice: 0 1 0 0; }
|
scrolledwindow junction:dir(rtl) { background: #1b1b1b, linear-gradient(to bottom, transparent 1px, #313131 1px), linear-gradient(to left, transparent 1px, #313131 1px); }
|
||||||
|
|
||||||
scrolledwindow junction:backdrop { border-image-source: linear-gradient(to bottom, #202020 1px, transparent 1px); background-color: #2d2d2d; transition: 200ms ease-out; }
|
scrolledwindow junction:backdrop { transition: 200ms ease-out; background: #202020, linear-gradient(to bottom, transparent 1px, #2d2d2d 1px), linear-gradient(to right, transparent 1px, #2d2d2d 1px); }
|
||||||
|
|
||||||
|
scrolledwindow junction:backdrop:dir(rtl) { background: #202020, linear-gradient(to bottom, transparent 1px, #2d2d2d 1px), linear-gradient(to left, transparent 1px, #2d2d2d 1px); }
|
||||||
|
|
||||||
separator { background: #282828; min-width: 1px; min-height: 1px; }
|
separator { background: #282828; min-width: 1px; min-height: 1px; }
|
||||||
|
|
||||||
@@ -1755,6 +1759,8 @@ video image.osd { min-width: 64px; min-height: 64px; border-radius: 32px; }
|
|||||||
/************** GtkInfoBar * */
|
/************** GtkInfoBar * */
|
||||||
infobar { border-style: none; }
|
infobar { border-style: none; }
|
||||||
|
|
||||||
|
infobar.action:hover { background-color: #3e3b37; border-color: #353535; }
|
||||||
|
|
||||||
infobar.info, infobar.question, infobar.warning, infobar.error { text-shadow: none; }
|
infobar.info, infobar.question, infobar.warning, infobar.error { text-shadow: none; }
|
||||||
|
|
||||||
infobar.info:backdrop, infobar.info, infobar.question:backdrop, infobar.question, infobar.warning:backdrop, infobar.warning, infobar.error:backdrop, infobar.error { background-color: #44403b; border-color: #353535; }
|
infobar.info:backdrop, infobar.info, infobar.question:backdrop, infobar.question, infobar.warning:backdrop, infobar.warning, infobar.error:backdrop, infobar.error { background-color: #44403b; border-color: #353535; }
|
||||||
|
@@ -41,6 +41,8 @@ image.drag-icon { -gtk-icon-size: 32px; }
|
|||||||
|
|
||||||
textview { outline: none; }
|
textview { outline: none; }
|
||||||
|
|
||||||
|
textview:drop(active) { caret-color: #4e9a06; }
|
||||||
|
|
||||||
textview border { background-color: #fbfafa; }
|
textview border { background-color: #fbfafa; }
|
||||||
|
|
||||||
.rubberband, rubberband, flowbox rubberband, treeview.view rubberband, .content-view rubberband, .content-view .rubberband { border: 1px solid #1b6acb; background-color: rgba(27, 106, 203, 0.2); }
|
.rubberband, rubberband, flowbox rubberband, treeview.view rubberband, .content-view rubberband, .content-view .rubberband { border: 1px solid #1b6acb; background-color: rgba(27, 106, 203, 0.2); }
|
||||||
@@ -1557,11 +1559,13 @@ scrolledwindow overshoot.right { background-image: radial-gradient(farthest-side
|
|||||||
|
|
||||||
scrolledwindow overshoot.right:backdrop { background-image: radial-gradient(farthest-side at right, #d5d0cc 85%, rgba(213, 208, 204, 0)); background-size: 3% 100%; background-repeat: no-repeat; background-position: right; background-color: transparent; border: none; box-shadow: none; }
|
scrolledwindow overshoot.right:backdrop { background-image: radial-gradient(farthest-side at right, #d5d0cc 85%, rgba(213, 208, 204, 0)); background-size: 3% 100%; background-repeat: no-repeat; background-position: right; background-color: transparent; border: none; box-shadow: none; }
|
||||||
|
|
||||||
scrolledwindow junction { border-color: transparent; border-image: linear-gradient(to bottom, #cdc7c2 1px, transparent 1px) 0 0 0 1/0 1px stretch; background-color: #cecece; }
|
scrolledwindow junction { background: #cdc7c2, linear-gradient(to bottom, transparent 1px, #cecece 1px), linear-gradient(to right, transparent 1px, #cecece 1px); }
|
||||||
|
|
||||||
scrolledwindow junction:dir(rtl) { border-image-slice: 0 1 0 0; }
|
scrolledwindow junction:dir(rtl) { background: #cdc7c2, linear-gradient(to bottom, transparent 1px, #cecece 1px), linear-gradient(to left, transparent 1px, #cecece 1px); }
|
||||||
|
|
||||||
scrolledwindow junction:backdrop { border-image-source: linear-gradient(to bottom, #d5d0cc 1px, transparent 1px); background-color: #efedec; transition: 200ms ease-out; }
|
scrolledwindow junction:backdrop { transition: 200ms ease-out; background: #d5d0cc, linear-gradient(to bottom, transparent 1px, #efedec 1px), linear-gradient(to right, transparent 1px, #efedec 1px); }
|
||||||
|
|
||||||
|
scrolledwindow junction:backdrop:dir(rtl) { background: #d5d0cc, linear-gradient(to bottom, transparent 1px, #efedec 1px), linear-gradient(to left, transparent 1px, #efedec 1px); }
|
||||||
|
|
||||||
separator { background: #d8d4d0; min-width: 1px; min-height: 1px; }
|
separator { background: #d8d4d0; min-width: 1px; min-height: 1px; }
|
||||||
|
|
||||||
@@ -1771,6 +1775,8 @@ video image.osd { min-width: 64px; min-height: 64px; border-radius: 32px; }
|
|||||||
/************** GtkInfoBar * */
|
/************** GtkInfoBar * */
|
||||||
infobar { border-style: none; }
|
infobar { border-style: none; }
|
||||||
|
|
||||||
|
infobar.action:hover { background-color: #f4ebe1; border-color: #e4e1de; }
|
||||||
|
|
||||||
infobar.info, infobar.question, infobar.warning, infobar.error { text-shadow: none; }
|
infobar.info, infobar.question, infobar.warning, infobar.error { text-shadow: none; }
|
||||||
|
|
||||||
infobar.info:backdrop, infobar.info, infobar.question:backdrop, infobar.question, infobar.warning:backdrop, infobar.warning, infobar.error:backdrop, infobar.error { background-color: #f1e6d9; border-color: #e4e1de; }
|
infobar.info:backdrop, infobar.info, infobar.question:backdrop, infobar.question, infobar.warning:backdrop, infobar.warning, infobar.error:backdrop, infobar.error { background-color: #f1e6d9; border-color: #e4e1de; }
|
||||||
|
Reference in New Issue
Block a user