mirror of
https://github.com/narrrl/proton-drive-linux.git
synced 2026-11-04 00:47:00 +01:00
The current folder in the breadcrumb trail was a bare label, so the "›"
before it hugged it while the ones between buttons sat in their padding.
One helper now builds the separator and the current segment for My Files,
Shared with me and Computers, with a flat button's side padding.
Grid tile names broke mid-word with a hyphen that is not in the name
("SteamSetup.e-xe"); turn Pango's inserted hyphens off.
22 lines
703 B
Rust
22 lines
703 B
Rust
use crate::*;
|
||
|
||
/// The "›" between two breadcrumb segments.
|
||
pub(crate) fn crumb_separator() -> gtk4::Label {
|
||
let sep = gtk4::Label::new(Some("›"));
|
||
sep.add_css_class("dim-label");
|
||
sep
|
||
}
|
||
|
||
/// The last breadcrumb segment, the folder on screen: a heading rather than a
|
||
/// button. It carries a flat button's side padding (`.crumb-current`), so the
|
||
/// "›" before it sits as far from it as from the button before.
|
||
pub(crate) fn crumb_current(label: &str) -> gtk4::Widget {
|
||
let l = gtk4::Label::builder()
|
||
.label(label)
|
||
.ellipsize(gtk4::pango::EllipsizeMode::Start)
|
||
.build();
|
||
l.add_css_class("heading");
|
||
l.add_css_class("crumb-current");
|
||
l.upcast()
|
||
}
|