Re: Changing background of TextView makes selection invisible

2015-06-14 Thread Bálint Réczey
Cross posting to devel because devs don't read the original list

2015-06-14 23:51 GMT+02:00 Kasper Peeters kasper.peet...@phi-sci.com:
 Before you start following the page it is owth noting that
 gtk_widget_override_color(), which function is recommended here for
 you want to do

 No, that overrides the color of the text of the widget, not the
 background color.

 There is 'gtk_override_background_color' (also deprecated since 3.16)
 but that exhibits the same problem as the CSS-based solution: while the
 color of the background indeed changes, it also sets the color of the
 selection highlight to the same color. As a result, when you select
 text in this TextView, you cannot see how much you have selected.
Is there anyone who knows a solution for that?

Cheers,
Balint
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: Changing background of TextView makes selection invisible

2015-06-14 Thread Bálint Réczey
Cross posting to devel because devs don't read the original list

2015-06-14 23:51 GMT+02:00 Kasper Peeters kasper.peet...@phi-sci.com:
 Before you start following the page it is owth noting that
 gtk_widget_override_color(), which function is recommended here for
 you want to do

 No, that overrides the color of the text of the widget, not the
 background color.

 There is 'gtk_override_background_color' (also deprecated since 3.16)
 but that exhibits the same problem as the CSS-based solution: while the
 color of the background indeed changes, it also sets the color of the
 selection highlight to the same color. As a result, when you select
 text in this TextView, you cannot see how much you have selected.
Is there anyone who knows a solution for that?

Cheers,
Balint
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Changing background of TextView makes selection invisible

2015-06-14 Thread Bálint Réczey
Hi,

2015-06-13 18:34 GMT+02:00 Stefan Salewski m...@ssalewski.de:
 On Sat, 2015-06-13 at 11:03 +0100, Kasper Peeters wrote:
 I am trying to make the background colour of all TextViews white,

 Have you followed this page:

 https://developer.gnome.org/gtk3/stable/TextWidget.html
Before you start following the page it is owth noting that
gtk_widget_override_color(), which function is recommended here for
you want to do is deprecated in 3.16 :-/ :
https://developer.gnome.org/gtk3/stable/GtkWidget.html#gtk-widget-override-color

I have the same problem in Wireshark, but have not fixed it yet.
Probably next week.

Cheers,
Balint
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Changing background of TextView makes selection invisible

2015-06-14 Thread Yann Leboulanger
On 06/14/2015 11:33 PM, Bálint Réczey wrote:
 Hi,

 2015-06-13 18:34 GMT+02:00 Stefan Salewski m...@ssalewski.de:
 On Sat, 2015-06-13 at 11:03 +0100, Kasper Peeters wrote:
 I am trying to make the background colour of all TextViews white,
 Have you followed this page:

 https://developer.gnome.org/gtk3/stable/TextWidget.html
 Before you start following the page it is owth noting that
 gtk_widget_override_color(), which function is recommended here for
 you want to do is deprecated in 3.16 :-/ :
 https://developer.gnome.org/gtk3/stable/GtkWidget.html#gtk-widget-override-color

 I have the same problem in Wireshark, but have not fixed it yet.
 Probably next week.

Personnaly it's 2 years [0] I would like to change its color from the
code when something happens, and go back to the default color when it's
finished, but that's doesn't seem something GTK3 allows if I understand
things correctly.

https://mail.gnome.org/archives/gtk-list/2013-July/msg00067.html

-- 
Yann
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Changing background of TextView makes selection invisible

2015-06-14 Thread Kasper Peeters
 Before you start following the page it is owth noting that
 gtk_widget_override_color(), which function is recommended here for
 you want to do

No, that overrides the color of the text of the widget, not the
background color.

There is 'gtk_override_background_color' (also deprecated since 3.16)
but that exhibits the same problem as the CSS-based solution: while the
color of the background indeed changes, it also sets the color of the
selection highlight to the same color. As a result, when you select
text in this TextView, you cannot see how much you have selected.

Cheers,
Kasper
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Changing background of TextView makes selection invisible

2015-06-13 Thread Stefan Salewski
On Sat, 2015-06-13 at 11:03 +0100, Kasper Peeters wrote:
 I am trying to make the background colour of all TextViews white,

Have you followed this page:

https://developer.gnome.org/gtk3/stable/TextWidget.html


___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Changing background of TextView makes selection invisible

2015-06-13 Thread Kasper Peeters
I am trying to make the background colour of all TextViews white, using
something along the lines of (this is gtkmm, but the problem is the same
in pure gtk):

  Glib::ustring data = GtkTextView { background: white; };
  auto css = Gtk::CssProvider::create();
  css-load_from_data(data);
  auto screen = Gdk::Screen::get_default();
  
Gtk::StyleContext::add_provider_for_screen(screen,css,GTK_STYLE_PROVIDER_PRIORITY_USER);

This does make the background white, but it also makes the colour used
for selection highlight white. As a result, I can't see anymore what I
am selecting.

A different colour leads to the same result: the highlight colour
becomes the same as the background colour, and hence the selection
becomes invisible. The same also happens when using the
override_background_color(..) function of the widget.

Is this a bug? (this is with gtk-3.10.8). Or am I doing something wrong?
Thanks!

Cheers,
Kasper
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list