-
Notifications
You must be signed in to change notification settings - Fork 323
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
Updated breadcrumb UI to new design #7362
Updated breadcrumb UI to new design #7362
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// a separator between entries, and an ellipsis. The breadcrumbs implementation selects the needed | ||
/// representation for each entry in the grid view. For efficiency, text label and icons are | ||
/// allocated once the entry is created. | ||
/// An internal structure of [`Entry`]. It has four visual representations: text, an icon (before a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically not true, if we look at the variants of State
(which was the source of this three representations
statement). I'd rather say text has an optional icon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment was out of date and belonged to the first attempt to refactor the breadcrumbs. Fixed now.
@@ -92,6 +95,10 @@ pub mod ellipsis { | |||
// === Style === | |||
// ============= | |||
|
|||
/// The width of the icon in a text [`Entry`]. | |||
pub const ICON_WIDTH: f32 = 30.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the attached screenshot, I see the width of the gap between data ▶︎
and icon read
to be enormous. I wonder if it is caused by incorrect size or the fact that we don't have separate padding and size settings for the icon. Also, shouldn't it be in the stylesheet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed the gap and this is now matching the design. This was caused by too large icon size, resulting in space around the icon.
Also, shouldn't it be in the stylesheet?
All the icon sizes here are fixed, so this is following the current implementation.
self.text.set_x(ICON_WIDTH); | ||
} else { | ||
self.icon.unset_parent(); | ||
self.icon.set_size((0.0, 0.0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. Removed.
} | ||
} | ||
|
||
impl Default for Breadcrumb { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be derived automatically (recent clippy has a lint for that)
|
||
let breadcrumbs = app.new_view::<Breadcrumbs>(); | ||
breadcrumbs.set_y(400.0); | ||
breadcrumbs.frp().set_size(Vector2(500.0, 100.0)); | ||
breadcrumbs.set_entries_from(( | ||
vec![ | ||
Breadcrumb::from("home"), | ||
Breadcrumb::from("data"), | ||
Breadcrumb::new_with_icon("read", icon::Id::DataInput), | ||
], | ||
0, | ||
)); | ||
breadcrumbs.set_base_layer(&app.display.default_scene.layers.node_searcher); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note that in #7350 breadcrumbs were moved to the documentation view (and to the documentation demo-scene), so there would be a merge conflict in this place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -11,3 +11,5 @@ ensogl-derive-theme = { path = "../../../../../../lib/rust/ensogl/app/theme/deri | |||
ensogl-hardcoded-theme = { path = "../../../../../../lib/rust/ensogl/app/theme/hardcoded" } | |||
ensogl-text = { path = "../../../../../../lib/rust/ensogl/component/text" } | |||
ensogl-grid-view = { path = "../../../../../../lib/rust/ensogl/component/grid-view" } | |||
ide-view-component-list-panel-grid = { path = "../grid" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do breadcrumbs still need this dependency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
Separator, | ||
} | ||
|
||
#[allow(missing_docs)] | ||
#[derive(Clone, Copy, CloneRef, Debug, Default, PartialEq)] | ||
#[derive(Clone, Copy, Debug, Default, PartialEq)] | ||
enum State { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A private enum, does not need #[allow(missing_docs)]
…ser_breadcrumbs_to_new_design # Conflicts: # CHANGELOG.md
QA: 🟢 |
…ser_breadcrumbs_to_new_design # Conflicts: # app/gui/view/component-browser/component-list-panel/breadcrumbs/src/lib.rs
Pull Request Description
Implements ##7199
Important Notes
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
./run ide build
.