mirror of
https://github.com/transmission/transmission
synced 2024-12-24 00:34:04 +00:00
(gtk) #5190 'Add borders instead of shadow on scrolled window': fixed, patch by nagisa
This commit is contained in:
parent
dc42791380
commit
29d6f5d934
1 changed files with 21 additions and 10 deletions
|
@ -605,12 +605,13 @@ GtkWidget *
|
||||||
gtr_window_new (GtkApplication * app, GtkUIManager * ui_mgr, TrCore * core)
|
gtr_window_new (GtkApplication * app, GtkUIManager * ui_mgr, TrCore * core)
|
||||||
{
|
{
|
||||||
int i, n;
|
int i, n;
|
||||||
const char * pch;
|
const char * pch, * style;
|
||||||
PrivateData * p;
|
PrivateData * p;
|
||||||
GtkWidget * ul_lb, * dl_lb;
|
GtkWidget * ul_lb, * dl_lb;
|
||||||
GtkWidget * mainmenu, *toolbar, *filter, *list, *status;
|
GtkWidget * mainmenu, *toolbar, *filter, *list, *status;
|
||||||
GtkWidget * vbox, *w, *self, *h, *hbox, *menu;
|
GtkWidget * vbox, *w, *self, *h, *hbox, *menu;
|
||||||
GtkWindow * win;
|
GtkWindow * win;
|
||||||
|
GtkCssProvider * css_provider;
|
||||||
GSList * l;
|
GSList * l;
|
||||||
|
|
||||||
p = g_new0 (PrivateData, 1);
|
p = g_new0 (PrivateData, 1);
|
||||||
|
@ -629,6 +630,15 @@ gtr_window_new (GtkApplication * app, GtkUIManager * ui_mgr, TrCore * core)
|
||||||
if (gtr_pref_flag_get (TR_KEY_main_window_is_maximized))
|
if (gtr_pref_flag_get (TR_KEY_main_window_is_maximized))
|
||||||
gtk_window_maximize (win);
|
gtk_window_maximize (win);
|
||||||
gtk_window_add_accel_group (win, gtk_ui_manager_get_accel_group (ui_mgr));
|
gtk_window_add_accel_group (win, gtk_ui_manager_get_accel_group (ui_mgr));
|
||||||
|
/* Add style provider to the window. */
|
||||||
|
/* Please move it to separate .css file if you’re adding more styles here. */
|
||||||
|
style = ".tr-workarea {border-width: 1px 0; border-style: solid; border-radius: 0;}";
|
||||||
|
css_provider = gtk_css_provider_new ();
|
||||||
|
gtk_css_provider_load_from_data (css_provider, style,
|
||||||
|
strlen (style), NULL);
|
||||||
|
gtk_style_context_add_provider_for_screen(gdk_screen_get_default (),
|
||||||
|
GTK_STYLE_PROVIDER (css_provider),
|
||||||
|
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||||
|
|
||||||
/* window's main container */
|
/* window's main container */
|
||||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||||
|
@ -736,7 +746,8 @@ gtr_window_new (GtkApplication * app, GtkUIManager * ui_mgr, TrCore * core)
|
||||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (w),
|
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (w),
|
||||||
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
|
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
|
||||||
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (w),
|
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (w),
|
||||||
GTK_SHADOW_IN);
|
GTK_SHADOW_OUT);
|
||||||
|
gtk_style_context_add_class (gtk_widget_get_style_context (w), "tr-workarea");
|
||||||
gtk_container_add (GTK_CONTAINER (w), p->view);
|
gtk_container_add (GTK_CONTAINER (w), p->view);
|
||||||
|
|
||||||
/* lay out the widgets */
|
/* lay out the widgets */
|
||||||
|
|
Loading…
Reference in a new issue