Commit 0172949a authored by Alberts Muktupāvels's avatar Alberts Muktupāvels
Browse files

common: fix GfPopupWindow style

- popup window style fixed for both GTK+ builtin themes.
- better support when using gnome-flashback without compositing
  manager.
parent be77573c
@import url("resource:///org/gnome/gnome-flashback/Adwaita.css");
gf-popup-window {
background-color: #393f3f;
border: 1px solid rgba(28, 31, 31, 0.9);
border-radius: 10px;
}
gf-popup-window.solid {
border: 1px solid #1f2222;
border-radius: 0px;
}
@import url("resource:///org/gnome/gnome-flashback/Adwaita.css");
gf-popup-window {
background-color: #e8e8e7;
border: 1px solid rgba(0, 0, 0, 0.23);
border-radius: 10px;
}
gf-popup-window.solid {
border: 1px solid #a5a5a1;
border-radius: 0px;
}
/* HightContrast theme does not have dark variant. */
@import url("resource:///org/gnome/gnome-flashback/theme/HighContrast/gnome-panel.css");
@import url("resource:///org/gnome/gnome-flashback/theme/HighContrast/gnome-flashback.css");
@import url("resource:///org/gnome/gnome-flashback/HighContrast.css");
gf-popup-window {
background-color: #ffffff;
border: 1px solid rgba(0, 0, 0, 0.23);
border-radius: 10px;
}
gf-popup-window.solid {
border: 1px solid #8d8d8d;
border-radius: 0px;
}
GfPopupWindow
{
border-radius: 20px;
border: 1px solid rgba(0, 0, 0, 0.23);
}
GfInputSourcePopup #input-source
{
font-size: 22px;
......
GfPopupWindow
{
border-radius: 20px;
border: 1px solid rgba(0, 0, 0, 0.23);
}
GfInputSourcePopup #input-source
{
font-size: 22px;
......
......@@ -21,7 +21,8 @@
typedef struct _GfPopupWindowPrivate GfPopupWindowPrivate;
struct _GfPopupWindowPrivate
{
guint fade_id;
gboolean composited;
guint fade_id;
};
enum
......@@ -49,7 +50,7 @@ fade_out_cb (gpointer user_data)
opacity = gtk_widget_get_opacity (widget);
opacity -= 0.04;
if (opacity < 0.00)
if (!priv->composited || opacity < 0.00)
{
gtk_widget_set_opacity (widget, 1.0);
......@@ -128,6 +129,27 @@ get_background_surface (GtkWidget *widget,
return surface;
}
static void
gf_popup_window_composited_changed (GtkWidget *widget)
{
GfPopupWindow *window;
GfPopupWindowPrivate *priv;
GdkScreen *screen;
GtkStyleContext *context;
window = GF_POPUP_WINDOW (widget);
priv = gf_popup_window_get_instance_private (window);
screen = gtk_widget_get_screen (widget);
context = gtk_widget_get_style_context (widget);
priv->composited = gdk_screen_is_composited (screen);
if (priv->composited)
gtk_style_context_remove_class (context, "solid");
else
gtk_style_context_add_class (context, "solid");
}
static gboolean
gf_popup_window_draw (GtkWidget *widget,
cairo_t *cr)
......@@ -158,12 +180,26 @@ gf_popup_window_draw (GtkWidget *widget,
static void
gf_popup_window_realize (GtkWidget *widget)
{
GfPopupWindow *window;
GfPopupWindowPrivate *priv;
GdkScreen *screen;
GtkStyleContext *context;
GdkVisual *visual;
window = GF_POPUP_WINDOW (widget);
priv = gf_popup_window_get_instance_private (window);
screen = gtk_widget_get_screen (widget);
context = gtk_widget_get_style_context (widget);
priv->composited = gdk_screen_is_composited (screen);
visual = gdk_screen_get_rgba_visual (screen);
if (priv->composited)
gtk_style_context_remove_class (context, "solid");
else
gtk_style_context_add_class (context, "solid");
if (visual == NULL)
visual = gdk_screen_get_system_visual (screen);
......@@ -183,12 +219,15 @@ gf_popup_window_class_init (GfPopupWindowClass *window_class)
object_class->finalize = gf_popup_window_finalize;
widget_class->composited_changed = gf_popup_window_composited_changed;
widget_class->draw = gf_popup_window_draw;
widget_class->realize = gf_popup_window_realize;
signals[SIGNAL_FADE_FINISHED] =
g_signal_new ("fade-finished", G_OBJECT_CLASS_TYPE (window_class),
G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 0);
gtk_widget_class_set_css_name (widget_class, "gf-popup-window");
}
static void
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment