elementary / stylesheet

The GTK Stylesheet for elementary OS
https://elementary.io
GNU General Public License v3.0
320 stars 74 forks source link

Add flat text entry box #946

Open hanaral opened 3 years ago

hanaral commented 3 years ago

Problem

In many situations, having the inset text entry box looks off. This is especially the case with renaming items in the Granite.SourceList or in the Files app, where the items are tightly packed and appear flat on the UI by default. There also seems to be a couple of places something similar is being used, but there is no overarching widget that can be used anywhere.

Proposal

There should be a Granite.FlatEntry that has custom styling to make the text box not have a box around it, and instead has a rounded 'pill' like accent colour outline for when it is selected. Another idea may be to automatically put the symbolic pencil icon at the end of the box when hovered to make it obvious it can be edited - and then the symbolic delete icon in the pencil's place while being edited

Prior Art

Something like this but an actual widget that can be selected with a keyboard Screenshot from 2021-01-31 11 39 36

danirabbit commented 3 years ago

This already exists and is a stylesheet feature. You can add Gtk.STYLE_CLASS_FLAT to entries for a flat style. I don't think there really needs to be a widget here. If it's important to have the pencil on hover, that could be done in the stylesheet too.

Moving to stylesheet for further conversation

hanaral commented 3 years ago

Also how about making the pencil thingy a default? I’d argue a pretty good thing, but I’m wondering why Files and such doesn’t use it instead of the weird inset box... Is this HIG territory or unfinished territory?