mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-02-02 19:27:38 +08:00
Compare commits
No commits in common. "132ab12c326ae4b5cbd158ad2465f6988022d414" and "18685b17ec5c1b7a08b9739a28d3d481227bae5b" have entirely different histories.
132ab12c32
...
18685b17ec
@ -1700,30 +1700,22 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="qml/page/T_RadioButton.qml" line="38"/>
|
<location filename="qml/page/T_RadioButton.qml" line="38"/>
|
||||||
<location filename="qml/page/T_RadioButton.qml" line="81"/>
|
<location filename="qml/page/T_RadioButton.qml" line="80"/>
|
||||||
<location filename="qml/page/T_RadioButton.qml" line="134"/>
|
|
||||||
<location filename="qml/page/T_RadioButton.qml" line="187"/>
|
|
||||||
<source>Disabled</source>
|
<source>Disabled</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="qml/page/T_RadioButton.qml" line="64"/>
|
<location filename="qml/page/T_RadioButton.qml" line="63"/>
|
||||||
<location filename="qml/page/T_RadioButton.qml" line="117"/>
|
|
||||||
<location filename="qml/page/T_RadioButton.qml" line="170"/>
|
|
||||||
<source>Radio Button_1</source>
|
<source>Radio Button_1</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="qml/page/T_RadioButton.qml" line="68"/>
|
<location filename="qml/page/T_RadioButton.qml" line="67"/>
|
||||||
<location filename="qml/page/T_RadioButton.qml" line="121"/>
|
|
||||||
<location filename="qml/page/T_RadioButton.qml" line="174"/>
|
|
||||||
<source>Radio Button_2</source>
|
<source>Radio Button_2</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="qml/page/T_RadioButton.qml" line="72"/>
|
<location filename="qml/page/T_RadioButton.qml" line="71"/>
|
||||||
<location filename="qml/page/T_RadioButton.qml" line="125"/>
|
|
||||||
<location filename="qml/page/T_RadioButton.qml" line="178"/>
|
|
||||||
<source>Radio Button_3</source>
|
<source>Radio Button_3</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -1808,30 +1808,22 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="qml/page/T_RadioButton.qml" line="38"/>
|
<location filename="qml/page/T_RadioButton.qml" line="38"/>
|
||||||
<location filename="qml/page/T_RadioButton.qml" line="81"/>
|
<location filename="qml/page/T_RadioButton.qml" line="80"/>
|
||||||
<location filename="qml/page/T_RadioButton.qml" line="134"/>
|
|
||||||
<location filename="qml/page/T_RadioButton.qml" line="187"/>
|
|
||||||
<source>Disabled</source>
|
<source>Disabled</source>
|
||||||
<translation type="unfinished">禁用</translation>
|
<translation type="unfinished">禁用</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="qml/page/T_RadioButton.qml" line="64"/>
|
<location filename="qml/page/T_RadioButton.qml" line="63"/>
|
||||||
<location filename="qml/page/T_RadioButton.qml" line="117"/>
|
|
||||||
<location filename="qml/page/T_RadioButton.qml" line="170"/>
|
|
||||||
<source>Radio Button_1</source>
|
<source>Radio Button_1</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="qml/page/T_RadioButton.qml" line="68"/>
|
<location filename="qml/page/T_RadioButton.qml" line="67"/>
|
||||||
<location filename="qml/page/T_RadioButton.qml" line="121"/>
|
|
||||||
<location filename="qml/page/T_RadioButton.qml" line="174"/>
|
|
||||||
<source>Radio Button_2</source>
|
<source>Radio Button_2</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="qml/page/T_RadioButton.qml" line="72"/>
|
<location filename="qml/page/T_RadioButton.qml" line="71"/>
|
||||||
<location filename="qml/page/T_RadioButton.qml" line="125"/>
|
|
||||||
<location filename="qml/page/T_RadioButton.qml" line="178"/>
|
|
||||||
<source>Radio Button_3</source>
|
<source>Radio Button_3</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -58,7 +58,6 @@ FluScrollablePage{
|
|||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
left: parent.left
|
left: parent.left
|
||||||
}
|
}
|
||||||
currentIndex: 1
|
|
||||||
FluRadioButton{
|
FluRadioButton{
|
||||||
disabled: radio_button_switch2.checked
|
disabled: radio_button_switch2.checked
|
||||||
text: qsTr("Radio Button_1")
|
text: qsTr("Radio Button_1")
|
||||||
@ -98,110 +97,4 @@ FluScrollablePage{
|
|||||||
}'
|
}'
|
||||||
}
|
}
|
||||||
|
|
||||||
FluFrame{
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.preferredHeight: 60
|
|
||||||
padding: 10
|
|
||||||
Layout.topMargin: 20
|
|
||||||
FluRadioButtons{
|
|
||||||
spacing: 8
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
anchors{
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
left: parent.left
|
|
||||||
}
|
|
||||||
orientation: Qt.Horizontal
|
|
||||||
currentIndex: 1
|
|
||||||
FluRadioButton{
|
|
||||||
disabled: radio_button_switch3.checked
|
|
||||||
text: qsTr("Radio Button_1")
|
|
||||||
}
|
|
||||||
FluRadioButton{
|
|
||||||
disabled: radio_button_switch3.checked
|
|
||||||
text: qsTr("Radio Button_2")
|
|
||||||
}
|
|
||||||
FluRadioButton{
|
|
||||||
disabled: radio_button_switch3.checked
|
|
||||||
text: qsTr("Radio Button_3")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FluToggleSwitch{
|
|
||||||
id: radio_button_switch3
|
|
||||||
anchors{
|
|
||||||
right: parent.right
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
text: qsTr("Disabled")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CodeExpander{
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.topMargin: -6
|
|
||||||
code:'FluRadioButtons{
|
|
||||||
spacing: 8
|
|
||||||
orientation: Qt.Horizontal
|
|
||||||
FluRadioButton{
|
|
||||||
text:"Radio Button_1"
|
|
||||||
}
|
|
||||||
FluRadioButton{
|
|
||||||
text:"Radio Button_2"
|
|
||||||
}
|
|
||||||
FluRadioButton{
|
|
||||||
text:"Radio Button_3"
|
|
||||||
}
|
|
||||||
}'
|
|
||||||
}
|
|
||||||
|
|
||||||
FluFrame{
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.preferredHeight: 100
|
|
||||||
padding: 10
|
|
||||||
Layout.topMargin: 20
|
|
||||||
FluRadioButtons{
|
|
||||||
spacing: 8
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
anchors{
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
left: parent.left
|
|
||||||
}
|
|
||||||
currentIndex: 1
|
|
||||||
FluCheckBox{
|
|
||||||
disabled: radio_button_switch4.checked
|
|
||||||
text: qsTr("Radio Button_1")
|
|
||||||
}
|
|
||||||
FluCheckBox{
|
|
||||||
disabled: radio_button_switch4.checked
|
|
||||||
text: qsTr("Radio Button_2")
|
|
||||||
}
|
|
||||||
FluCheckBox{
|
|
||||||
disabled: radio_button_switch4.checked
|
|
||||||
text: qsTr("Radio Button_3")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FluToggleSwitch{
|
|
||||||
id: radio_button_switch4
|
|
||||||
anchors{
|
|
||||||
right: parent.right
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
text: qsTr("Disabled")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CodeExpander{
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.topMargin: -6
|
|
||||||
code:'FluRadioButtons{
|
|
||||||
spacing: 8
|
|
||||||
FluCheckBox{
|
|
||||||
text:"Radio Button_1"
|
|
||||||
}
|
|
||||||
FluCheckBox{
|
|
||||||
text:"Radio Button_2"
|
|
||||||
}
|
|
||||||
FluCheckBox{
|
|
||||||
text:"Radio Button_3"
|
|
||||||
}
|
|
||||||
}'
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -271,7 +271,6 @@ void FluFrameless::componentComplete() {
|
|||||||
*result = TRUE;
|
*result = TRUE;
|
||||||
return true;
|
return true;
|
||||||
} else if (uMsg == WM_GETMINMAXINFO) {
|
} else if (uMsg == WM_GETMINMAXINFO) {
|
||||||
#if (QT_VERSION == QT_VERSION_CHECK(6, 5, 3) || QT_VERSION == QT_VERSION_CHECK(6, 6, 0))
|
|
||||||
auto *minmaxInfo = reinterpret_cast<MINMAXINFO *>(lParam);
|
auto *minmaxInfo = reinterpret_cast<MINMAXINFO *>(lParam);
|
||||||
auto pixelRatio = window()->devicePixelRatio();
|
auto pixelRatio = window()->devicePixelRatio();
|
||||||
auto geometry = window()->screen()->availableGeometry();
|
auto geometry = window()->screen()->availableGeometry();
|
||||||
@ -281,7 +280,6 @@ void FluFrameless::componentComplete() {
|
|||||||
minmaxInfo->ptMaxPosition.y = rect.top;
|
minmaxInfo->ptMaxPosition.y = rect.top;
|
||||||
minmaxInfo->ptMaxSize.x = qRound(geometry.width() * pixelRatio);
|
minmaxInfo->ptMaxSize.x = qRound(geometry.width() * pixelRatio);
|
||||||
minmaxInfo->ptMaxSize.y = qRound(geometry.height() * pixelRatio);
|
minmaxInfo->ptMaxSize.y = qRound(geometry.height() * pixelRatio);
|
||||||
#endif
|
|
||||||
return false;
|
return false;
|
||||||
} else if (_isWindows11OrGreater && (uMsg == WM_NCLBUTTONDBLCLK || uMsg == WM_NCLBUTTONDOWN)) {
|
} else if (_isWindows11OrGreater && (uMsg == WM_NCLBUTTONDBLCLK || uMsg == WM_NCLBUTTONDOWN)) {
|
||||||
if (_hitMaximizeButton()) {
|
if (_hitMaximizeButton()) {
|
||||||
|
@ -3,76 +3,30 @@ import QtQuick.Controls 2.15
|
|||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts 1.15
|
||||||
import FluentUI 1.0
|
import FluentUI 1.0
|
||||||
|
|
||||||
Item{
|
ColumnLayout {
|
||||||
id:control
|
default property alias buttons: control.data
|
||||||
default property list<QtObject> buttons
|
|
||||||
property int currentIndex : -1
|
property int currentIndex : -1
|
||||||
property int spacing: 8
|
id:control
|
||||||
property int orientation: Qt.Vertical
|
onCurrentIndexChanged: {
|
||||||
QtObject{
|
|
||||||
id: d
|
|
||||||
function updateChecked(){
|
|
||||||
if(buttons.length === 0){
|
|
||||||
return
|
|
||||||
}
|
|
||||||
for(var i = 0;i<buttons.length;i++){
|
for(var i = 0;i<buttons.length;i++){
|
||||||
buttons[i].checked = false
|
buttons[i].checked = false
|
||||||
}
|
}
|
||||||
buttons[currentIndex].checked = true
|
var button = buttons[currentIndex]
|
||||||
|
if(button){
|
||||||
|
button.checked = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
implicitWidth: childrenRect.width
|
|
||||||
implicitHeight: childrenRect.height
|
|
||||||
onCurrentIndexChanged: {
|
|
||||||
d.updateChecked()
|
|
||||||
}
|
|
||||||
Component{
|
|
||||||
id:com_vertical
|
|
||||||
ColumnLayout {
|
|
||||||
data: control.buttons
|
|
||||||
spacing: control.spacing
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
for(var i = 0;i<control.buttons.length;i++){
|
for(var i = 0;i<buttons.length;i++){
|
||||||
control.buttons[i].clickListener = function(){
|
buttons[i].clickListener = function(){
|
||||||
for(var i = 0;i<control.buttons.length;i++){
|
for(var i = 0;i<buttons.length;i++){
|
||||||
var button = control.buttons[i]
|
var button = buttons[i]
|
||||||
if(this === button){
|
if(this === button){
|
||||||
control.currentIndex = i
|
currentIndex = i
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(control.currentIndex < 0){
|
currentIndex = 0
|
||||||
control.currentIndex = 0
|
|
||||||
}
|
|
||||||
d.updateChecked()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Component{
|
|
||||||
id:com_horizontal
|
|
||||||
RowLayout {
|
|
||||||
data: buttons
|
|
||||||
spacing: control.spacing
|
|
||||||
Component.onCompleted: {
|
|
||||||
for(var i = 0;i<control.buttons.length;i++){
|
|
||||||
control.buttons[i].clickListener = function(){
|
|
||||||
for(var i = 0;i<control.buttons.length;i++){
|
|
||||||
var button = control.buttons[i]
|
|
||||||
if(this === button){
|
|
||||||
control.currentIndex = i
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(control.currentIndex < 0){
|
|
||||||
control.currentIndex = 0
|
|
||||||
}
|
|
||||||
d.updateChecked()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FluLoader{
|
|
||||||
sourceComponent: control.orientation === Qt.Vertical ? com_vertical : com_horizontal
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,76 +4,30 @@ import QtQuick.Controls.Basic
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Item{
|
ColumnLayout {
|
||||||
id:control
|
default property alias buttons: control.data
|
||||||
default property list<QtObject> buttons
|
|
||||||
property int currentIndex : -1
|
property int currentIndex : -1
|
||||||
property int spacing: 8
|
id:control
|
||||||
property int orientation: Qt.Vertical
|
onCurrentIndexChanged: {
|
||||||
QtObject{
|
|
||||||
id: d
|
|
||||||
function updateChecked(){
|
|
||||||
if(buttons.length === 0){
|
|
||||||
return
|
|
||||||
}
|
|
||||||
for(var i = 0;i<buttons.length;i++){
|
for(var i = 0;i<buttons.length;i++){
|
||||||
buttons[i].checked = false
|
buttons[i].checked = false
|
||||||
}
|
}
|
||||||
buttons[currentIndex].checked = true
|
var button = buttons[currentIndex]
|
||||||
|
if(button){
|
||||||
|
button.checked = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
implicitWidth: childrenRect.width
|
|
||||||
implicitHeight: childrenRect.height
|
|
||||||
onCurrentIndexChanged: {
|
|
||||||
d.updateChecked()
|
|
||||||
}
|
|
||||||
Component{
|
|
||||||
id:com_vertical
|
|
||||||
ColumnLayout {
|
|
||||||
data: control.buttons
|
|
||||||
spacing: control.spacing
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
for(var i = 0;i<control.buttons.length;i++){
|
for(var i = 0;i<buttons.length;i++){
|
||||||
control.buttons[i].clickListener = function(){
|
buttons[i].clickListener = function(){
|
||||||
for(var i = 0;i<control.buttons.length;i++){
|
for(var i = 0;i<buttons.length;i++){
|
||||||
var button = control.buttons[i]
|
var button = buttons[i]
|
||||||
if(this === button){
|
if(this === button){
|
||||||
control.currentIndex = i
|
currentIndex = i
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(control.currentIndex < 0){
|
currentIndex = 0
|
||||||
control.currentIndex = 0
|
|
||||||
}
|
|
||||||
d.updateChecked()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Component{
|
|
||||||
id:com_horizontal
|
|
||||||
RowLayout {
|
|
||||||
data: buttons
|
|
||||||
spacing: control.spacing
|
|
||||||
Component.onCompleted: {
|
|
||||||
for(var i = 0;i<control.buttons.length;i++){
|
|
||||||
control.buttons[i].clickListener = function(){
|
|
||||||
for(var i = 0;i<control.buttons.length;i++){
|
|
||||||
var button = control.buttons[i]
|
|
||||||
if(this === button){
|
|
||||||
control.currentIndex = i
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(control.currentIndex < 0){
|
|
||||||
control.currentIndex = 0
|
|
||||||
}
|
|
||||||
d.updateChecked()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FluLoader{
|
|
||||||
sourceComponent: control.orientation === Qt.Vertical ? com_vertical : com_horizontal
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user