Skip to content

Commit e0bb730

Browse files
committed
fix(win): add mut to the correct place
1 parent 062604b commit e0bb730

8 files changed

Lines changed: 14 additions & 14 deletions

File tree

src/ui/windows/button.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub struct Button {
1818

1919
impl Button {
2020
pub fn new(parent: impl AsWindow) -> Self {
21-
let handle = Widget::new(
21+
let mut handle = Widget::new(
2222
WC_BUTTONW,
2323
WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON as u32,
2424
0,

src/ui/windows/check_box.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub struct CheckBox {
1919

2020
impl CheckBox {
2121
pub fn new(parent: impl AsWindow) -> Self {
22-
let handle = Widget::new(
22+
let mut handle = Widget::new(
2323
WC_BUTTONW,
2424
WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_CHECKBOX as u32,
2525
0,

src/ui/windows/combo_box.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ impl<const E: bool> ComboBoxImpl<E> {
2929
} else {
3030
style |= CBS_DROPDOWNLIST as u32;
3131
}
32-
let handle = Widget::new(WC_COMBOBOXW, style, 0, parent.as_window().as_raw_window());
32+
let mut handle = Widget::new(WC_COMBOBOXW, style, 0, parent.as_window().as_raw_window());
3333
handle.set_size(handle.size_d2l((50, 14)));
3434
Self { handle }
3535
}

src/ui/windows/edit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ struct EditImpl {
2525

2626
impl EditImpl {
2727
pub fn new(parent: impl AsWindow, style: u32) -> Self {
28-
let handle = Widget::new(
28+
let mut handle = Widget::new(
2929
WC_EDITW,
3030
style,
3131
WS_EX_CLIENTEDGE,

src/ui/windows/label.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub struct Label {
2121

2222
impl Label {
2323
pub fn new(parent: impl AsWindow) -> Self {
24-
let handle = Widget::new(
24+
let mut handle = Widget::new(
2525
WC_STATICW,
2626
WS_CHILD | WS_VISIBLE | SS_LEFT,
2727
0,

src/ui/windows/progress.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub struct Progress {
1818

1919
impl Progress {
2020
pub fn new(parent: impl AsWindow) -> Self {
21-
let handle = Widget::new(
21+
let mut handle = Widget::new(
2222
PROGRESS_CLASSW,
2323
WS_CHILD | WS_VISIBLE | WS_TABSTOP | PBS_SMOOTHREVERSE,
2424
0,

src/ui/windows/radio_button.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub struct RadioButton {
1919

2020
impl RadioButton {
2121
pub fn new(parent: impl AsWindow) -> Self {
22-
let handle = Widget::new(
22+
let mut handle = Widget::new(
2323
WC_BUTTONW,
2424
WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_RADIOBUTTON as u32,
2525
0,

src/ui/windows/window.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ impl Widget {
142142
(rect.right - rect.left, rect.bottom - rect.top)
143143
}
144144

145-
fn set_sized(&self, v: (i32, i32)) {
145+
fn set_sized(&mut self, v: (i32, i32)) {
146146
let handle = self.as_raw_window();
147147
if v != self.sized() {
148148
syscall!(
@@ -165,7 +165,7 @@ impl Widget {
165165
self.size_d2l(self.sized())
166166
}
167167

168-
pub fn set_size(&self, v: Size) {
168+
pub fn set_size(&mut self, v: Size) {
169169
self.set_sized(self.size_l2d(v))
170170
}
171171

@@ -188,7 +188,7 @@ impl Widget {
188188
}
189189
}
190190

191-
fn set_locd(&self, p: (i32, i32)) {
191+
fn set_locd(&mut self, p: (i32, i32)) {
192192
let handle = self.as_raw_window();
193193
if p != self.locd() {
194194
syscall!(
@@ -211,7 +211,7 @@ impl Widget {
211211
self.point_d2l(self.locd())
212212
}
213213

214-
pub fn set_loc(&self, p: Point) {
214+
pub fn set_loc(&mut self, p: Point) {
215215
self.set_locd(self.point_l2d(p))
216216
}
217217

@@ -239,7 +239,7 @@ impl Widget {
239239
self.text_u16().to_string_lossy()
240240
}
241241

242-
pub fn set_text(&self, s: impl AsRef<str>) {
242+
pub fn set_text(&mut self, s: impl AsRef<str>) {
243243
let handle = self.as_raw_window();
244244
let s = U16CString::from_str_truncate(s);
245245
syscall!(BOOL, unsafe { SetWindowTextW(handle, s.as_ptr()) }).unwrap();
@@ -272,7 +272,7 @@ impl Widget {
272272
.unwrap()
273273
}
274274

275-
pub fn set_style(&self, style: u32) {
275+
pub fn set_style(&mut self, style: u32) {
276276
unsafe { SetLastError(0) };
277277
let res = syscall!(
278278
BOOL,
@@ -289,7 +289,7 @@ impl Widget {
289289
}
290290
}
291291

292-
pub fn set_icon(&self, icon: HICON) {
292+
pub fn set_icon(&mut self, icon: HICON) {
293293
unsafe {
294294
SendMessageW(self.as_raw_window(), WM_SETICON, ICON_BIG as _, icon as _);
295295
}

0 commit comments

Comments
 (0)