From: Detlef R. <det...@gm...> - 2016-05-11 19:07:50
Attachments:
border.png
|
Hi, this may be completely the wrong list, but may be someone can help :-) I have a Gtk::Frame which is styled with CSS.This is the relevant part of the css file: frame#tabs { border-style: solid; border-color: @frame_border_tabs @transparent @frame_border_tabs @frame_border_tabs; border-width: 0.2em 0.32em 0.05em 0.1em; border-radius: 1.2em 0.7em 0.7em 1.2em; padding: 0.25em 0.25em 0.25em 0.25em; } It is drawn as in the attached image. The outer rounded border is like expected. The rectangular one should from my point of view not be visible. And before the CSS changes of gtk it was not. Is it also a new behavior, where I have to change my css / code? It also _now_ seems to be theme dependent. Before the changes with the same theme it worked as expected. The _problematic_ theme is Xfce-4.6 from debian testing. detlef |
From: cedlemo <ce...@gm...> - 2016-05-12 14:06:34
|
> this may be completely the wrong list, This list is more related to the ruby-gnome2 bindings and its support. > but may be someone can help but I am curious so I will try to help you Can you give informations: which debian Gtk version Desktop (Gnome, Xfce) and version theme used. Is the problem specific for an application you created Have you/use you a custom Css configuration?. Cedlemo On 11/05/2016 20:53, Detlef Reichl wrote: > Hi, > > this may be completely the wrong list, but may be someone can help :-) > > > I have a Gtk::Frame which is styled with CSS.This is the relevant part > of the css file: > > frame#tabs { > border-style: solid; > border-color: @frame_border_tabs @transparent @frame_border_tabs > @frame_border_tabs; > border-width: 0.2em 0.32em 0.05em 0.1em; > border-radius: 1.2em 0.7em 0.7em 1.2em; > padding: 0.25em 0.25em 0.25em 0.25em; > } > > > It is drawn as in the attached image. The outer rounded border is like > expected. The rectangular one should from my point of view not be > visible. And before the CSS changes of gtk it was not. Is it also a > new behavior, where I have to change my css / code? It also _now_ > seems to be theme dependent. Before the changes with the same theme it > worked as expected. The _problematic_ theme is Xfce-4.6 from debian > testing. > > detlef > > > ------------------------------------------------------------------------------ > Mobile security can be enabling, not merely restricting. Employees who > bring their own devices (BYOD) to work are irked by the imposition of MDM > restrictions. Mobile Device Manager Plus allows you to control only the > apps on BYO-devices by containerizing them, leaving personal data untouched! > https://ad.doubleclick.net/ddm/clk/304595813;131938128;j > > > _______________________________________________ > ruby-gnome2-devel-en mailing list > rub...@li... > https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en |
From: Detlef R. <det...@gm...> - 2016-05-12 18:15:43
|
Hi, Am 12.05.2016 um 16:06 schrieb cedlemo: > > this may be completely the wrong list, > This list is more related to the ruby-gnome2 bindings and its support. > > > but may be someone can help > but I am curious so I will try to help you > > Can you give informations: > > which debian testing > Gtk version 3.20.3 > Desktop (Gnome, Xfce) and version Xfce 4.12 > theme used. Adwaita, Gilouche and "high contrast" show the problem. > Is the problem specific for an application you created It is a special purpose widget, something like a Gtk::Notebook with grouped tabs. If other applications have the same problem, I don't know. But the widget may be very specific. > Have you/use you a custom Css configuration?. The specific part of the css file I already posted with my last mail. Here is a small example, that shows the problem on my system. #!/usr/bin/env ruby require "gtk3" provider = Gtk::CssProvider.new css = <<-CSS @define-color frame_border_tabs rgb(70%, 70%, 70%); @define-color transparent rgba(0, 0, 0, 0.0); frame#tabs { border-style: solid; border-color: @frame_border_tabs @transparent @frame_border_tabs @frame_border_tabs; border-width: 0.2em 0.32em 0.05em 0.1em; border-radius: 1.2em 0.7em 0.7em 1.2em; padding: 0.25em 0.25em 0.25em 0.25em; } CSS provider.load :data => css screen = Gdk::Display.default.default_screen Gtk::StyleContext.add_provider_for_screen(screen, provider, Gtk::StyleProvider::PRIORITY_USER) window = Gtk::Window.new frame = Gtk::Frame.new window << frame label = Gtk::Label.new 'Content' frame << label frame.name = 'tabs' frame.style_context.add_provider provider, GLib::MAXUINT window.show_all window.signal_connect "destroy" do Gtk.main_quit end Gtk.main Thanks, detlef > > > Cedlemo > > On 11/05/2016 20:53, Detlef Reichl wrote: >> Hi, >> >> this may be completely the wrong list, but may be someone can help :-) >> >> >> I have a Gtk::Frame which is styled with CSS.This is the relevant part >> of the css file: >> >> frame#tabs { >> border-style: solid; >> border-color: @frame_border_tabs @transparent @frame_border_tabs >> @frame_border_tabs; >> border-width: 0.2em 0.32em 0.05em 0.1em; >> border-radius: 1.2em 0.7em 0.7em 1.2em; >> padding: 0.25em 0.25em 0.25em 0.25em; >> } >> >> >> It is drawn as in the attached image. The outer rounded border is like >> expected. The rectangular one should from my point of view not be >> visible. And before the CSS changes of gtk it was not. Is it also a >> new behavior, where I have to change my css / code? It also _now_ >> seems to be theme dependent. Before the changes with the same theme it >> worked as expected. The _problematic_ theme is Xfce-4.6 from debian >> testing. >> >> detlef >> >> >> ------------------------------------------------------------------------------ >> Mobile security can be enabling, not merely restricting. Employees who >> bring their own devices (BYOD) to work are irked by the imposition of MDM >> restrictions. Mobile Device Manager Plus allows you to control only the >> apps on BYO-devices by containerizing them, leaving personal data untouched! >> https://ad.doubleclick.net/ddm/clk/304595813;131938128;j >> >> >> _______________________________________________ >> ruby-gnome2-devel-en mailing list >> rub...@li... >> https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en > > > > ------------------------------------------------------------------------------ > Mobile security can be enabling, not merely restricting. Employees who > bring their own devices (BYOD) to work are irked by the imposition of MDM > restrictions. Mobile Device Manager Plus allows you to control only the > apps on BYO-devices by containerizing them, leaving personal data untouched! > https://ad.doubleclick.net/ddm/clk/304595813;131938128;j > _______________________________________________ > ruby-gnome2-devel-en mailing list > rub...@li... > https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en > |
From: cedlemo <ce...@gm...> - 2016-05-12 20:11:11
|
Hey Detlef Reichl, Good news I find out why it does this. First the outline that you see is in fact the decoration of the frame. If you add a label to the frame, it is more obvious. frame = Gtk::Frame.new("frame") FYI it should be better (IMO) to use a Gtk::box instead of using a frame without label and hiding the decoration The solution first and the explications later: Here is the script with a Css that hide the decoration of the frame #!/usr/bin/env ruby require "gtk3" provider = Gtk::CssProvider.new css = <<-CSS @define-color frame_border_tabs rgb(70%, 70%, 70%); @define-color transparent rgba(0, 0, 0, 0.0); frame#tabs { border-style: solid; border-color: @frame_border_tabs @transparent @frame_border_tabs @frame_border_tabs; border-width: 0.2em 0.32em 0.05em 0.1em; border-radius: 1.2em 0.7em 0.7em 1.2em; /*padding: 0.25em 0.25em 0.25em 0.25em;*/ } frame border { border-style: none; border-color: @transparent @transparent @transparent @transparent; box-shadow: none; border-width: 10px; border-radius: 0px; margin: 0px; outline-color: @transparent; } CSS provider.load :data => css screen = Gdk::Display.default.default_screen Gtk::StyleContext.add_provider_for_screen(screen, provider, Gtk::StyleProvider::PRIORITY_USER) window = Gtk::Window.new frame = Gtk::Frame.new("frame") window << frame label = Gtk::Label.new 'Content' frame << label frame.name = 'tabs' frame.style_context.add_provider provider, GLib::MAXUINT window.show_all window.signal_connect "destroy" do Gtk.main_quit end Gtk.main The important part of the css is the frame border selector. look here https://developer.gnome.org/gtk3/stable/GtkFrame.html they say : CSS nodes frame ├── border ├── <labelwidget> ╰── <child> GtkFrame has a main CSS node with name frame and a subnode with name border. The border node is used to render the visible border. The style class .flat can appear with the main node. For real example here is the arc theme https://github.com/horst3180/arc-theme frame > border, .frame { margin: 0; padding: 0; border-radius: 0; border: 1px solid #dcdfe3; } frame > border.flat, .frame.flat { border-style: none; } Here is another example from the Zukitre theme https://github.com/lassekongo83/zuki-themes /********** * Frames * **********/ frame > border, .frame { box-shadow: none; margin: 0; padding: 0; border-radius: 0; border: 1px solid #b0b0b0; } frame > border.flat, .frame.flat { border-style: none; } frame > border:backdrop, .frame:backdrop { border-color: #b4b4b4; } Those new selectors come with Gtk 3.20. I hope this will help you. Regards cedlemo https://github.com/cedlemo |
From: Detlef R. <det...@gm...> - 2016-05-13 03:01:27
|
Hi cedlemo, thank you very much for the solution and your explanation. I had the mistaken idea, that the border arguments in the style would modify the frames decoration, but not the widgets outline. best regards, detlef Am 12.05.2016 um 22:10 schrieb cedlemo: > Hey Detlef Reichl, > > Good news I find out why it does this. > > First the outline that you see is in fact the decoration of the frame. > If you add a label to the frame, it is more obvious. > > > frame = Gtk::Frame.new("frame") > > > FYI it should be better (IMO) to use a Gtk::box instead of > using a frame without label and hiding the decoration > > > The solution first and the explications later: > > Here is the script with a Css that hide the decoration of the frame > > #!/usr/bin/env ruby > require "gtk3" > > provider = Gtk::CssProvider.new > > css = <<-CSS > @define-color frame_border_tabs rgb(70%, 70%, 70%); > @define-color transparent rgba(0, 0, 0, 0.0); > > frame#tabs { > border-style: solid; > border-color: @frame_border_tabs @transparent @frame_border_tabs > @frame_border_tabs; > border-width: 0.2em 0.32em 0.05em 0.1em; > border-radius: 1.2em 0.7em 0.7em 1.2em; > /*padding: 0.25em 0.25em 0.25em 0.25em;*/ > } > > frame border { > border-style: none; > border-color: @transparent @transparent @transparent @transparent; > box-shadow: none; > border-width: 10px; > border-radius: 0px; > margin: 0px; > outline-color: @transparent; > > } > > CSS > > provider.load :data => css > > screen = Gdk::Display.default.default_screen > Gtk::StyleContext.add_provider_for_screen(screen, > provider, > > Gtk::StyleProvider::PRIORITY_USER) > > window = Gtk::Window.new > frame = Gtk::Frame.new("frame") > window << frame > label = Gtk::Label.new 'Content' > frame << label > > frame.name = 'tabs' > frame.style_context.add_provider provider, GLib::MAXUINT > > window.show_all > window.signal_connect "destroy" do > Gtk.main_quit > end > Gtk.main > > The important part of the css is the frame border selector. > > > look here https://developer.gnome.org/gtk3/stable/GtkFrame.html > > they say : > > > CSS nodes > > frame > ├── border > > ├── <labelwidget> > > ╰── <child> > > > GtkFrame has a main CSS node with name frame and a subnode with name > border. The border node is used to render the visible border. The style > class .flat can appear with the main node. > > > For real example here is the arc theme > https://github.com/horst3180/arc-theme > > frame > border, .frame { > margin: 0; > padding: 0; > border-radius: 0; > border: 1px solid #dcdfe3; > } > frame > border.flat, .frame.flat { border-style: none; } > > Here is another example from the Zukitre theme > https://github.com/lassekongo83/zuki-themes > > /********** * Frames * **********/ > frame > border, .frame { > box-shadow: none; > margin: 0; > padding: 0; > border-radius: 0; > border: 1px solid #b0b0b0; > } > frame > border.flat, .frame.flat { > border-style: none; > } > frame > border:backdrop, .frame:backdrop { border-color: #b4b4b4; } > > Those new selectors come with Gtk 3.20. > > I hope this will help you. Regards > > cedlemo > > https://github.com/cedlemo > > > ------------------------------------------------------------------------------ > Mobile security can be enabling, not merely restricting. Employees who > bring their own devices (BYOD) to work are irked by the imposition of MDM > restrictions. Mobile Device Manager Plus allows you to control only the > apps on BYO-devices by containerizing them, leaving personal data untouched! > https://ad.doubleclick.net/ddm/clk/304595813;131938128;j > _______________________________________________ > ruby-gnome2-devel-en mailing list > rub...@li... > https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en > |