Skip to content
This repository has been archived by the owner on May 12, 2022. It is now read-only.

Commit

Permalink
feat(ui): take pal::Wm as a parameter in Entry[Core]::new
Browse files Browse the repository at this point in the history
It turned out to be necessary when implementing `Entry[Core]::set_text`.
  • Loading branch information
yvt committed May 23, 2020
1 parent e030e9c commit 3431538
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 83 deletions.
4 changes: 1 addition & 3 deletions stella2/meta/lib.tcwdl
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,7 @@ comp crate::view::MainView {
child_generic = get!(&search_bar_entry),
};

const search_bar_entry = EntryCore::new! {
style_manager,
};
const search_bar_entry = EntryCore::new! { wm, style_manager };

const channel_list_wrap = StyledBox::new! {
style_manager,
Expand Down
2 changes: 1 addition & 1 deletion tcw3/examples/tcw3_widgets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ fn main() {
view
};

let entry = Entry::new(style_manager);
let entry = Entry::new(wm, style_manager);

let button = Button::new(style_manager);
button.set_caption("Please don't touch this button");
Expand Down
2 changes: 2 additions & 0 deletions tcw3/meta/views/entry.tcwdl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use crate::{ui::theming::{ClassSet, StyledBox, HElem, Manager}, uicore::HView};
#[widget]
#[builder(simple)]
pub comp crate::ui::views::Entry {
const wm: crate::pal::Wm { pub set; }
const style_manager: &Manager { pub set; }

prop class_set: ClassSet { pub set; get clone; } = ?;
Expand All @@ -18,6 +19,7 @@ pub comp crate::ui::views::Entry {
#[widget]
#[builder(simple)]
pub comp crate::ui::views::EntryCore {
const wm: crate::pal::Wm { pub set; }
const style_manager: &Manager { pub set; }

const view: HView { pub get clone; } = ?;
Expand Down
Loading

0 comments on commit 3431538

Please sign in to comment.