Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy does the hover animation ignore the transition time and function in Gtk3?
    primarykey
    data
    text
    <p>With the new gtk, it is possible to create graphical themes with a file in something like css. </p> <p>Given this css file (named <code>my-gtk-widgets.css</code>):</p> <pre><code>.button { border-radius: 0; border-style: solid; } .button:hover { transition: 3000ms linear; border-radius: 50; } </code></pre> <p>And the following python code:</p> <pre><code>from gi.repository import Gtk from gi.repository import Gdk def _destroy_cb(widget, data=None): Gtk.main_quit() window = Gtk.Window() window.connect("destroy", _destroy_cb) screen = Gdk.Screen.get_default() css_provider = Gtk.CssProvider() css_provider.load_from_path('my-gtk-widgets.css') context = Gtk.StyleContext() context.add_provider_for_screen(screen, css_provider, Gtk.STYLE_PROVIDER_PRIORITY_USER) box = Gtk.VBox() window.add(box) button = Gtk.Button('go-next') box.pack_start(button, False, False, 0) window.show_all() Gtk.main() </code></pre> <p>Running this code gives a button which changes the border-radius when hovered. But the transition is instant, not animated. </p> <p><img src="https://i.stack.imgur.com/BCxIN.png" alt="enter image description here"></p> <p><img src="https://i.stack.imgur.com/gh2z8.png" alt="enter image description here"></p> <p>What is the reason for this? Do I need a different version of gtk, python, ... ? Or does this animation depend on the gtk theme (in my case the Ubuntu default <code>Ambience</code>)? Or is there something wrong in my css file?</p> <p>python version: 2.7.2+</p> <p>gtk version: 3.0</p> <p>EDIT: the example is a modified version of <a href="http://gnomejournal.org/article/107/styling-gtk-with-css" rel="nofollow noreferrer">this</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload