Surrealism-All / SurrealismUI

A third-party UI library using Slint, I think it will give you an extraordinary experience
https://surrealism-all.github.io/SurrealismUI.github.io/
MIT License
197 stars 19 forks source link

请问SCheckBox下,没看到checked这个值,怎么获取是否选中的状态?我去看了源码也没发现。我把SCheckBox的height这个属性设置到80px之后,里面的SCard出现在左上角,然后SText是居中的,请问是需要设置在外部设置它们两个的对齐方式吗?感谢您的回答 #34

Closed FiveKm closed 5 months ago

syf20020816 commented 5 months ago

It seems I forget to add example into SurrealismUI Book you can get actived prop from SCheckbox, In SurrealismUI all check state named actived you can see this example: https://github.com/Surrealism-All/SurrealismUI/blob/main/tests/src/checkbox.slint and if you see the source code, you can find that SCheckbox is a line widget which means if you make a Rectangle outside the widget and set height it will make SCheckbox inherits height:

Rectangle{
   height: 60px;
   SCheckbox{}
}

我好像忘了在SurrealismUI书中添加示例 您可以从SCheckbox中获取“actived”道具,在SurrealsimUI中,所有名为“actived` 您可以看到以下示例:https://github.com/Surrealism-All/SurrealismUI/blob/main/tests/src/checkbox.slint 如果你看到源代码,你会发现SCheckbox是一个行小部件,这意味着如果你需要在小部件外部制作一个矩形并设置高度,SCheckbox会继承外部高度:

syf20020816 commented 5 months ago

by the way, you can use a short title issue, and add detail information in description

syf20020816 commented 5 months ago

Is your requirement for SCheckbox to maintain in line display or for it to occupy a certain height without displaying collapse

你的需求是为了让SCheckbox保持行内显示,还是使它可以占据一定的高度而不显示塌陷

maybe I need to make SCheckbox height flexable

FiveKm commented 5 months ago

thanks for your answer,I thought active was an indication of whether SCheckBox was active or not。 Rectangle{ width: 180px; height: 40px; SCheckbox{ text: "L" + (i+1) + " - G"+(j+1); actived: true; visible: true; } Snipaste_2024-04-08_10-28-25

FiveKm commented 5 months ago

I want Scard and SText to be centered in SCheckBox

syf20020816 commented 5 months ago

OK I think, That is a desire to let SCheckbox can put into any layout and still hold in a line.

I will fix it in 30 minutes and republish the V0.4.2 pag

FiveKm commented 5 months ago

Hopefully SurrealismUI will get better and better and used by more people, there is a setting that has bothered me for a few days, please ask why SCheckbox's TouchArea is set in SCard, instead of covering the entire area like Slint's native CheckBox

syf20020816 commented 5 months ago

I have already finish update now you can directly use:

SCheckbox {
                height: 40px;
}
syf20020816 commented 5 months ago

Hopefully SurrealismUI will get better and better and used by more people, there is a setting that has bothered me for a few days, please ask why SCheckbox's TouchArea is set in SCard, instead of covering the entire area like Slint's native CheckBox

The main purpose is to distinguish the click area. actually SurrealismUI still as a low level widget, I wanna each widget can be controlled. that means you can use SurrealismUI as a basic widget and secondary build your own widget lib

FiveKm commented 5 months ago

I tested the new version and it works fine。Thank you for your answers and for sharing the course on the Bilibili website。