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

Missing style classes in Granite 7 to port from Gtk3 to Gtk4 #617

Open
marbetschar opened this issue Jun 18, 2022 · 5 comments
Open

Missing style classes in Granite 7 to port from Gtk3 to Gtk4 #617

marbetschar opened this issue Jun 18, 2022 · 5 comments

Comments

@marbetschar
Copy link
Member

I started working on the Gtk4 port of Mail and noticed that the following Gtk3 style classes are not available in Granite. Not sure if this is a bug or intentional - in any case, please advise how to migrate them to Gtk4 / Granite 7:

@danirabbit
Copy link
Member

Oops yeah SIDEBAR and BACKGROUND are definitely an oversight and need to be added

action bars previously using INLINE_TOOLBAR should use FLAT instead

I don’t think the stylesheet has a style for .toolbar and Gtk.Toolbar was removed in Gtk4, so I’d be curious to know how that’s being used so we can figure out how to migrate it

@marbetschar
Copy link
Member Author

Regarding Gtk.STYLE_CLASS_TOOLBAR: Mail is only using it in the AttachmentBar.vala (used to list attachments below a message).

I will test if it makes any visual differences if the class is there - if so, I will hardcode the string value and otherwise simply remove the class alltogether. Would you agree to this course of action? Or do I miss something here?

@marbetschar
Copy link
Member Author

PS: Found another style class which is used in Mail but does not appear in Granite: Gtk.STYLE_CLASS_ENTRY - whats the migration path for this one?

@danirabbit
Copy link
Member

danirabbit commented Jun 20, 2022

@marbetschar ah so for the attachment one, probably either pack that into an actionbar?or set the css name of the flowbox to “actionbar”, whichever one preserves the styles better there. I’m pretty sure the “toolbar” style class is removed completely in the gtk4 stylesheet

I think the entry one is a workaround for not being able to pack children into an entry, but I think that’s changed in Gtk. That’s also used for cssname as well right? So you could manually set the cssname to “entry” for the same effect or see if we can pack those children to the end of the entry and drop all the style magic we’re doing there

@avojak
Copy link

avojak commented Aug 6, 2022

Possibly related, should there be a Granite.STYLE_CLASS_TITLEBAR? I noticed that Music uses the string "titlebar" instead of a constant (https://github.com/elementary/music/blob/main/src/MainWindow.vala#L34).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants