Closed LesF closed 6 years ago
[PATCH] Color settings for Gtk2 dark themes.
/**
* GtkInfoBar:message-type:
*
* The type of the message.
*
* The type is used to determine the colors to use in the info bar.
[...]
*
* If the type is #GTK_MESSAGE_OTHER, no info bar is painted but the
* colors are still set.
*
* Since: 2.18
*/
Ref.
https://git.gnome.org/browse/gtk+/tree/gtk/gtkinfobar.c?h=2.24.31#n376
---
lib/Analysis.pm | 2 +-
lib/GUI.pm | 12 ++++++------
lib/Network.pm | 8 ++++----
lib/Scan.pm | 6 +++---
lib/Settings.pm | 6 +++---
lib/Whitelist.pm | 4 ++--
6 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/lib/Analysis.pm b/lib/Analysis.pm
index 7b2b496..430c596 100644
--- a/lib/Analysis.pm
+++ b/lib/Analysis.pm
@@ -83,7 +83,7 @@ sub show_window {
$bar = Gtk2::InfoBar->new;
$box->pack_start( $bar, FALSE, FALSE, 0 );
- $bar->set_message_type( 'info' );
+ $bar->set_message_type( 'other' );
$bar->add_button( 'gtk-close', -7 );
$bar->signal_connect(
response => sub {
diff --git a/lib/GUI.pm b/lib/GUI.pm
index ff3e737..4a2b849 100644
--- a/lib/GUI.pm
+++ b/lib/GUI.pm
@@ -66,9 +66,9 @@ sub start_gui {
$window->set_icon( $transparent );
}
- my $white = Gtk2::Gdk::Color->new( 0xFFFF, 0xFFFF, 0xFFFF );
+ #my $white = Gtk2::Gdk::Color->new( 0xFFFF, 0xFFFF, 0xFFFF );
my $eb = Gtk2::EventBox->new;
- $eb->modify_bg( 'normal', $white );
+ #$eb->modify_bg( 'normal', $white );
$window->add( $eb );
$top_box = Gtk2::VBox->new( FALSE, 5 );
@@ -152,16 +152,16 @@ sub startup {
my ( $message_type, $message );
if ( $startup_check eq 'both' ) {
$message = _( 'Updates are available' );
- $message_type = 'warning';
+ $message_type = 'other';
} elsif ( $startup_check eq 'sigs' ) {
$message = _( 'The antivirus signatures are outdated' );
- $message_type = 'warning';
+ $message_type = 'other';
} elsif ( $startup_check eq 'gui' ) {
$message = _( 'An update is available' );
- $message_type = 'info';
+ $message_type = 'other';
} else {
$message = '';
- $message_type = 'info';
+ $message_type = 'other';
}
# Infobar is hidden typically, but if there
# are updates, we need to show it
diff --git a/lib/Network.pm b/lib/Network.pm
index e0aa2d2..f87599e 100644
--- a/lib/Network.pm
+++ b/lib/Network.pm
@@ -28,8 +28,8 @@ my $infobar; # Gtk2::InfoBar
sub show_window {
my $eb = Gtk2::EventBox->new;
- my $white = Gtk2::Gdk::Color->new( 0xFFFF, 0xFFFF, 0xFFFF );
- $eb->modify_bg( 'normal', $white );
+ #my $white = Gtk2::Gdk::Color->new( 0xFFFF, 0xFFFF, 0xFFFF );
+ #$eb->modify_bg( 'normal', $white );
#$eb->override_background_color( 'normal',
# Gtk2::Gdk::RGBA->new( .93, .93, .93, .93 ),
@@ -269,11 +269,11 @@ sub proxy_non_block_status {
if ( $status eq 'yes' ) {
$proxy_status_image->set_stock_id( 'gtk-yes' );
$message = _( 'Settings saved' );
- $infobar->set_message_type( 'info' );
+ $infobar->set_message_type( 'other' );
} else {
$proxy_status_image->set_stock_id( 'gtk-no' );
$message = _( 'Error' );
- $infobar->set_message_type( 'error' );
+ $infobar->set_message_type( 'other' );
}
set_infobar_text( $message );
$proxy_status_image->show;
diff --git a/lib/Scan.pm b/lib/Scan.pm
index b146760..b67f170 100644
--- a/lib/Scan.pm
+++ b/lib/Scan.pm
@@ -117,8 +117,8 @@ sub filter {
my $eb = Gtk2::EventBox->new;
$window->get_content_area->add( $eb );
- my $white = Gtk2::Gdk::Color->new( 0xFFFF, 0xFFFF, 0xFFFF );
- $eb->modify_bg( 'normal', $white );
+ #my $white = Gtk2::Gdk::Color->new( 0xFFFF, 0xFFFF, 0xFFFF );
+ #$eb->modify_bg( 'normal', $white );
my $box = Gtk2::VBox->new( FALSE, 5 );
$eb->add( $box );
@@ -158,7 +158,7 @@ sub filter {
$box->pack_start( $bottombar, FALSE, FALSE, 5 );
$bottombar->can_focus( FALSE );
- $bottombar->set_message_type( 'info' );
+ $bottombar->set_message_type( 'other' );
$bottombar->add_button( 'gtk-cancel', HATE_GNOME_SHELL );
if ( $show ) {
$bottombar->add_button( 'gtk-preferences', DESTROY_GNOME_SHELL );
diff --git a/lib/Settings.pm b/lib/Settings.pm
index ffcbaf6..4412413 100644
--- a/lib/Settings.pm
+++ b/lib/Settings.pm
@@ -25,8 +25,8 @@ use Locale::gettext;
sub show_window {
my $top_box = Gtk2::EventBox->new;
- my $white = Gtk2::Gdk::Color->new( 0xFFFF, 0xFFFF, 0xFFFF );
- $top_box->modify_bg( 'normal', $white );
+ #my $white = Gtk2::Gdk::Color->new( 0xFFFF, 0xFFFF, 0xFFFF );
+ #$top_box->modify_bg( 'normal', $white );
my $box = Gtk2::VBox->new( FALSE, 0 );
$top_box->add( $box );
@@ -135,7 +135,7 @@ sub show_window {
my $infobar = Gtk2::InfoBar->new;
#$box->pack_start( $infobar, FALSE, FALSE, 10 );
- $infobar->set_message_type( 'info' );
+ $infobar->set_message_type( 'other' );
$infobar->add_button( 'gtk-go-back', -7 );
$infobar->signal_connect(
response => sub {
diff --git a/lib/Whitelist.pm b/lib/Whitelist.pm
index abfb197..2430d64 100644
--- a/lib/Whitelist.pm
+++ b/lib/Whitelist.pm
@@ -27,8 +27,8 @@ my $system_whitelist = ClamTk::App->get_path( 'whitelist_dir' );
sub show_window {
my $eb = Gtk2::EventBox->new;
- my $white = Gtk2::Gdk::Color->new( 0xFFFF, 0xFFFF, 0xFFFF );
- $eb->modify_bg( 'normal', $white );
+ #my $white = Gtk2::Gdk::Color->new( 0xFFFF, 0xFFFF, 0xFFFF );
+ #$eb->modify_bg( 'normal', $white );
my $box = Gtk2::VBox->new( FALSE, 5 );
$eb->add( $box );
--
It also fits for Gtk2 light themes.
'info_default_fill_color' #FFFFBF - "pale yellow" https://git.gnome.org/browse/gtk+/tree/gtk/gtkinfobar.c?h=2.24.31#n508 designated as 'GTK_MESSAGE_INFO' background color https://git.gnome.org/browse/gtk+/tree/gtk/gtkinfobar.c?h=2.24.31#n548 is the clumsiest color there - for both Gtk2 theme variants, dark and light.
I'll take a look.
Thanks, Dave M
How do I use that Patch? Thanks,
Please see if 5.25 helps with this issue.
Thanks, Dave M
now works, thanks
The app appears to use the desktop font color but not the background color. Using XFCE 4.10 with a dark theme I have light text on dark background, which works ok on almost all applications I use. However clamtk does not use the theme colors and gives me unreadable text. If you are going to force the white background then you should force a dark text color as well.