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 > |