Skip to content

Colored action buttons for Gtk::FileChooserDialog #2208

Closed

Description

@Keyikedalube

Is your feature request related to a problem? Please describe.
Synfig file chooser dialog utilizes header bar while some dialogs utilize standard Gtk::Dialog with the title bar. It'll be more useful if action buttons placed in the header bar are colored like normal GTK/GNOME apps to visually guide/assist the user.

Describe the solution you'd like
GTK provides CSS classes suggested-action and destructive-action for action buttons OK/Open/Save and Cancel/Close respectively

Describe alternatives you've considered
-nil-

Additional comments

  • Current dialog: action buttons not colored
    Screenshot_2021-07-07_08-49-16

  • Suggested feature: colored action buttons
    Screenshot_2021-07-07_07-26-30

Activity

  1. nickleus27 commented on Jan 2, 2022

    @nickleus27
    Contributor

    is anyone working on this?

  2. rodolforg commented on Jan 2, 2022

    @rodolforg
    Contributor

    Not that I know of. :)

  3. nickleus27 commented on Jan 2, 2022

    @nickleus27
    Contributor

    cool. I will work on it if that is okay.

  4. nickleus27 commented on Jan 3, 2022

    @nickleus27
    Contributor

    @ice0 @rodolforg Am I understanding this correctly: any Gtk::FileChooserDialog should have colored action buttons? For example cancel or save buttons in the save diolog, or cancel and open in the open diolog?

  5. ice0 commented on Jan 3, 2022

    @ice0
    Collaborator

    @nickleus27
    Yes if it is possible. I haven't tested it, but maybe they just aren't customizable.

  6. nickleus27 commented on Jan 3, 2022

    @nickleus27
    Contributor

    @ice0 at the moment I am not finding any information on how to colorize the FileChooserDialog buttons. I understand how to colorize individual buttons, but not the FileChooserDialog buttons

  7. Keyikedalube commented on Jan 3, 2022

    @Keyikedalube
    ContributorAuthor

    Hello :)

    @nickleus27 if you're on Linux there's a package called gtk3-demo. I found out about colored action buttons in this example program Theming > Style Classes

    For Synfig IIRC you have to get the dialog object style context and call in object.add_class("action-name")

  8. nickleus27 commented on Jan 3, 2022

    @nickleus27
    Contributor

    @Keyikedalube Thank you, that is very helpful. I am experimenting with that now.

    Will that work with the dialog object since dialog is not a button?

  9. Keyikedalube commented on Jan 3, 2022

    @Keyikedalube
    ContributorAuthor

    @nickleus27 Forgive my incorrect answer. Instead of the entire dialog you have to get only the button's object style context.

  10. rodolforg commented on Jan 3, 2022

    @rodolforg
    Contributor

    @ice0 @rodolforg Am I understanding this correctly: any Gtk::FileChooserDialog should have colored action buttons? For example cancel or save buttons in the save diolog, or cancel and open in the open diolog?

    The aim is not to make everything colorful :D I believe @Keyikedalube suggested to follow these guidelines: https://wiki.gnome.org/HowDoI/Buttons .

  11. nickleus27 commented on Jan 3, 2022

    @nickleus27
    Contributor

    @rodolforg right, the idea is to use "suggested-action" class and destructive-action " class for the action buttons in the filechooserdialogs?

  12. nickleus27 commented on Jan 3, 2022

    @nickleus27
    Contributor

    Should I be using xml for this like the gtk+demo example and the reference Rodolfo posted? Because I have gotten it work with Keyikedalube's example using context->add_class()

    EDITED: I answered the first question in this comment, so I deleted it.

  13. rodolforg commented on Jan 3, 2022

    @rodolforg
    Contributor

    Should I be using xml for this like the gtk+demo example and the reference Rodolfo posted?

    No, you don't have to. Sometimes it could not be possible anyway

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions