Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GtkButton instead of GtkLabel for Modules #1120

Merged
merged 4 commits into from
Oct 17, 2022

Commits on Oct 12, 2022

  1. button: Add AButton class

    The AButton class is designed as full a substitute to ALabel. The
    GtkButton attribute 'button_' is initialized with a label. This
    label can the be referenced by the subsequent inheritors of AButton
    instead of the GtkLabel attribute 'label_' of ALabel.
    For convenience a GtkLabel* 'label_' attribute is added to AButton.
    
    If the button cannot be clicked it is disabled, effectively acting
    like its label predecessor.
    
    GtkButton seems to catch one-click mouse events regardless of the
    flags set on it. Therefore, 'signal_pressed' is connected to a
    function creating a fake GdkEventButton* and calling 'handleToggle'
    (for details on this possible bug in GTK see:
    https://stackoverflow.com/questions/45334911 )
    
    In accordance with other GtkButtons (i.e. the sway/workspace ones)
    set_relief(Gtk::RELIEF_NONE) is called on the 'button_' instance.
    pinselimo committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    b8322c4 View commit details
    Browse the repository at this point in the history
  2. resources: Set button hover effects globally

    Since now modules as well as workspaces are buttons, the fix for
    the 'strange hover effects' has to be applied on a global level.
    In return there is a nice hover effect also on the modules.
    pinselimo committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    0012bcb View commit details
    Browse the repository at this point in the history
  3. modules: Set style-context on button

    Fixes issue where the class parameters in style.css would have no
    effect.
    
    The CSS now references the GtkButton instead of the GtkLabel. Removing
    all style-classes from the custom module GtkButton however removes
    any properties set via style.css. Thus, the default classes 'flat' and
    'text-button' are added on every update of these modules.
    pinselimo committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    8fa5d9b View commit details
    Browse the repository at this point in the history
  4. modules: Set tooltip on button

    Mouse-over tooltips set on the label only appear once the mouse hovers
    over exactly the label. Other apps (e.g. firefox) show the tooltip once
    the pointer hovers the button. Not solely its label. With this commit we
    get the same behaviour.
    pinselimo committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    2b735f4 View commit details
    Browse the repository at this point in the history