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

Fix/ime position #494

Merged
merged 5 commits into from
Dec 20, 2023
Merged

Fix/ime position #494

merged 5 commits into from
Dec 20, 2023

Conversation

wjian23
Copy link
Contributor

@wjian23 wjian23 commented Dec 4, 2023

No description provided.

Copy link

codecov bot commented Dec 4, 2023

Codecov Report

Attention: 51 lines in your changes are missing coverage. Please review.

Comparison is base (9f8bef2) 85.45% compared to head (09d4042) 85.23%.
Report is 2 commits behind head on master.

❗ Current head 09d4042 differs from pull request most recent head 808276f. Consider uploading reports for the commit 808276f to get more accurate results

Files Patch % Lines
core/src/builtin_widgets/anchor.rs 67.56% 24 Missing ⚠️
widgets/src/input.rs 74.32% 19 Missing ⚠️
ribir/src/app.rs 0.00% 3 Missing ⚠️
themes/material/src/lib.rs 83.33% 2 Missing ⚠️
core/src/builtin_widgets.rs 96.55% 1 Missing ⚠️
core/src/widget_children/child_convert.rs 0.00% 1 Missing ⚠️
widgets/src/input/selected_text.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #494      +/-   ##
==========================================
- Coverage   85.45%   85.23%   -0.22%     
==========================================
  Files         177      178       +1     
  Lines       24378    24631     +253     
==========================================
+ Hits        20832    20995     +163     
- Misses       3546     3636      +90     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wjian23 wjian23 force-pushed the fix/ime_position branch 4 times, most recently from 750ddb3 to c1a169d Compare December 8, 2023 07:00
core/src/builtin_widgets.rs Outdated Show resolved Hide resolved
core/src/builtin_widgets.rs Outdated Show resolved Hide resolved
core/src/builtin_widgets.rs Outdated Show resolved Hide resolved
widgets/src/input.rs Outdated Show resolved Hide resolved
sologeek
sologeek previously approved these changes Dec 18, 2023
@wjian23 wjian23 force-pushed the fix/ime_position branch 2 times, most recently from dbb4a11 to 09d4042 Compare December 18, 2023 07:05
sologeek
sologeek previously approved these changes Dec 18, 2023
pub fn new(x: HAnchor, y: VAnchor) -> Self { Self { x: Some(x), y: Some(y) } }

/// Return Anchor that positions the widget's left top corner to the position
pub fn from_position(pos: Point) -> Self { Self::new(HAnchor::Left(pos.x), VAnchor::Top(pos.y)) }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from_point?

match (self, other) {
(HAnchor::Left(x1), HAnchor::Left(x2)) => HAnchor::Left(x1.lerp(x2, t)),
(HAnchor::Right(x1), HAnchor::Right(x2)) => HAnchor::Right(x1.lerp(x2, t)),
_ => unreachable!(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right None, None Left should implement Lerp, and should not panic when hit left <-->right

Comment on lines 44 to 45
child
.widget_build(ctx!())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems unnecessary attach

type Child = Widget;
#[inline]
fn compose_child(this: impl StateWriter<Value = Self>, child: Self::Child) -> impl WidgetBuilder {
fn eq(f1: Anchor, f2: Anchor) -> bool { f1.x == f2.x && f1.y == f2.y }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does Anchor Derive PartialEq

pub fn lazy_host_id(&self) -> LazyWidgetId { self.builtin.lazy_host_id() }

/// Return the LazyWidgetId of the external widget (wrapped with the built-in
/// host), through which you can access the WidgetId after building.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/// Return the LazyWidgetId point to WidgetId of the root of the sub widget tree after the
/// FatObj has built.

impl<W> FatObj<W> {
/// Anchor the widget's horizontal position to the left edge of the widget
/// with WidgetId wid .
pub fn relative_to_left(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left_align_to ? and relative is a f32 not HAnchor

@M-Adoo M-Adoo enabled auto-merge December 20, 2023 02:39
@M-Adoo M-Adoo added this pull request to the merge queue Dec 20, 2023
Merged via the queue into master with commit 0b00fff Dec 20, 2023
5 checks passed
@M-Adoo M-Adoo deleted the fix/ime_position branch December 20, 2023 05:12
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

Successfully merging this pull request may close these issues.

3 participants