summaryrefslogtreecommitdiffstats
path: root/perl-install/install/gtk.pm
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2013-11-06 17:08:25 +0100
committerThierry Vignaud <thierry.vignaud@gmail.com>2013-11-24 23:28:14 +0100
commit855389b387cb938db3ac1965027eacef37c36ef5 (patch)
tree6443a952d74b88a16ca20ae3f5966946a79fbad5 /perl-install/install/gtk.pm
parent71934d61b0508dc9abd16a29f8820d9aa317149d (diff)
downloaddrakx-855389b387cb938db3ac1965027eacef37c36ef5.tar
drakx-855389b387cb938db3ac1965027eacef37c36ef5.tar.gz
drakx-855389b387cb938db3ac1965027eacef37c36ef5.tar.bz2
drakx-855389b387cb938db3ac1965027eacef37c36ef5.tar.xz
drakx-855389b387cb938db3ac1965027eacef37c36ef5.zip
(load_rc) rename as 'load_css' and load CSS theme file
doc option is know to be broken for now
Diffstat (limited to 'perl-install/install/gtk.pm')
-rw-r--r--perl-install/install/gtk.pm11
1 files changed, 7 insertions, 4 deletions
diff --git a/perl-install/install/gtk.pm b/perl-install/install/gtk.pm
index ba16a56e1..0e1951b8b 100644
--- a/perl-install/install/gtk.pm
+++ b/perl-install/install/gtk.pm
@@ -14,6 +14,7 @@ use detect_devices;
#-INTERN CONSTANT
#-#####################################################################################
+# FIXME: either drop 'doc' option or convert this to CSS!
#- if we're running for the doc team, we want screenshots with
#- a good B&W contrast: we'll override values of our theme
my $theme_overriding_for_doc = q(style "galaxy-default"
@@ -53,13 +54,15 @@ widget "*logo*" style "background-logo"
);
#------------------------------------------------------------------------------
-sub load_rc {
+sub load_css {
my ($o, $name) = @_;
my $f = $name;
- -r $name or $f = find { -r $_ } map { "$_/themes-$name.rc" } ("share", $ENV{SHARE_PATH}, dirname(__FILE__) . '/..');
+ -r $name or $f = find { -r $_ } map { "$_/themes-$name.css" } ("share", $ENV{SHARE_PATH}, dirname(__FILE__) . '/..');
if ($f) {
- Gtk3::Rc->parse_string($o->{doc} ? $theme_overriding_for_doc : scalar cat_($f));
+ my $pl = Gtk3::CssProvider->new;
+ $pl->load_from_data($o->{doc} ? $theme_overriding_for_doc : scalar cat_($f));
+ my $cx = Gtk3::StyleContext::add_provider_for_screen(Gtk3::Gdk::Screen::get_default(), $pl, Gtk3::STYLE_PROVIDER_PRIORITY_APPLICATION);
}
}
@@ -94,7 +97,7 @@ my $root_window;
sub install_theme {
my ($o) = @_;
- load_rc($o, $o->{theme} ||= default_theme($o));
+ load_css($o, $o->{theme} ||= default_theme($o));
load_font($o);
my $win = gtknew('Window', widget_name => 'background', title => 'root window');