Remove custom drawing in system prompts

Custom drawing doesn't seem necessary. Fixes unwanted background in popovers.
parent 6e3df711
Pipeline #62265 passed with stages
in 37 minutes and 34 seconds
......@@ -261,24 +261,6 @@ phosh_network_auth_prompt_finalize (GObject *object)
}
static gboolean
network_prompt_draw_cb (GtkWidget *widget,
cairo_t *cr)
{
GtkStyleContext *context = gtk_widget_get_style_context (widget);
GdkRGBA c;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_style_context_get_background_color (context, GTK_STATE_FLAG_NORMAL, &c);
G_GNUC_END_IGNORE_DEPRECATIONS
cairo_set_source_rgba (cr, c.red, c.green, c.blue, 0.7);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
cairo_paint (cr);
return FALSE;
}
static gboolean
network_prompt_key_press_event_cb (PhoshNetworkAuthPrompt *self,
GdkEventKey *event)
......@@ -373,7 +355,6 @@ phosh_network_auth_prompt_class_init (PhoshNetworkAuthPromptClass *klass)
gtk_widget_class_bind_template_callback (widget_class, network_prompt_cancel_clicked_cb);
gtk_widget_class_bind_template_callback (widget_class, network_prompt_connect_clicked_cb);
gtk_widget_class_bind_template_callback (widget_class, network_prompt_draw_cb);
gtk_widget_class_bind_template_callback (widget_class, network_prompt_key_press_event_cb);
gtk_widget_class_bind_template_callback (widget_class, network_prompt_wpa_password_changed_cb);
gtk_widget_class_bind_template_callback (widget_class, network_prompt_icon_press_cb);
......
......@@ -388,22 +388,6 @@ on_btn_authenticate_clicked (PhoshPolkitAuthPrompt *self, GtkButton *btn)
}
static gboolean
draw_cb (GtkWidget *widget, cairo_t *cr, gpointer unused)
{
GtkStyleContext *context = gtk_widget_get_style_context (widget);
GdkRGBA c;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_style_context_get_background_color (context, GTK_STATE_FLAG_NORMAL, &c);
G_GNUC_END_IGNORE_DEPRECATIONS
cairo_set_source_rgba (cr, c.red, c.green, c.blue, 0.7);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
cairo_paint (cr);
return FALSE;
}
static gboolean
on_key_press_event (PhoshPolkitAuthPrompt *self, GdkEventKey *event, gpointer data)
{
......@@ -462,12 +446,6 @@ phosh_polkit_auth_prompt_constructed (GObject *object)
gtk_entry_set_buffer (GTK_ENTRY (self->entry_password),
GTK_ENTRY_BUFFER (self->password_buffer));
gtk_widget_set_app_paintable(GTK_WIDGET (self), TRUE);
g_signal_connect (G_OBJECT(self),
"draw",
G_CALLBACK(draw_cb),
NULL);
g_signal_connect_object (self->btn_cancel,
"clicked",
G_CALLBACK (on_btn_cancel_clicked),
......
......@@ -258,6 +258,10 @@ phosh-lockscreen phosh-media-player button:not(:hover):not(:active) {
/*
* System modal dialogs (polkit, gcr)
*/
.phosh-system-modal {
background-color: alpha(@theme_bg_color, 0.7);
}
.phosh-system-modal-dialog {
background-color: black;
border: solid 2px;
......
......@@ -526,21 +526,6 @@ phosh_system_prompt_iface_init (GcrPromptIface *iface)
iface->prompt_close = phosh_system_prompt_close;
}
static gboolean
draw_cb (GtkWidget *widget, cairo_t *cr, gpointer unused)
{
GtkStyleContext *context = gtk_widget_get_style_context (widget);
GdkRGBA c;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_style_context_get_background_color (context, GTK_STATE_FLAG_NORMAL, &c);
G_GNUC_END_IGNORE_DEPRECATIONS
cairo_set_source_rgba (cr, c.red, c.green, c.blue, 0.7);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
cairo_paint (cr);
return FALSE;
}
static gboolean
on_key_press_event (PhoshSystemPrompt *self, GdkEventKey *event, gpointer data)
......@@ -649,12 +634,6 @@ phosh_system_prompt_constructed (GObject *object)
G_CONNECT_SWAPPED);
gtk_widget_grab_default (priv->btn_continue);
gtk_widget_set_app_paintable(GTK_WIDGET (self), TRUE);
g_signal_connect (G_OBJECT(self),
"draw",
G_CALLBACK(draw_cb),
NULL);
gtk_widget_add_events (GTK_WIDGET (self), GDK_KEY_PRESS_MASK);
g_signal_connect (G_OBJECT (self),
"key_press_event",
......
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="PhoshNetworkAuthPrompt" parent="PhoshLayerSurface">
<property name="app-paintable">1</property>
<signal name="draw" handler="network_prompt_draw_cb" />
<signal name="key-press-event" handler="network_prompt_key_press_event_cb"/>
<child>
<object class="GtkBox">
......@@ -15,6 +13,7 @@
<property name="orientation">vertical</property>
<style>
<class name="phosh-system-modal-dialog"/>
<class name="phosh-network-auth-prompt"/>
</style>
<child>
......@@ -115,6 +114,9 @@
</object>
</child>
<style>
<class name="phosh-system-modal"/>
</style>
</template>
<!-- Grid to be shown for WEP/WPA passwords -->
......
......@@ -176,11 +176,12 @@
</child>
<style>
<class name="phosh-system-modal-dialog"/>
</style>
<style>
<class name="phosh-polkit-auth-agent"/>
<class name="phosh-polkit-auth-prompt"/>
</style>
</object>
</child>
<style>
<class name="phosh-system-modal"/>
</style>
</template>
</interface>
......@@ -207,11 +207,12 @@
</child>
<style>
<class name="phosh-system-modal-dialog"/>
<class name="phosh-system-prompt"/>
</style>
</object>
</child>
<style>
<class name="phosh-system-prompt"/>
<class name="phosh-system-modal"/>
</style>
</template>
</interface>
Markdown is supported
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