mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-03-11 06:17:30 +08:00
Compare commits
No commits in common. "f830d5a9bfc0f6836e6e2aa7c80d7201b730013f" and "2d4e61445e28c4f428d487b6d8438f025f2a1e2e" have entirely different histories.
f830d5a9bf
...
2d4e61445e
@ -22,37 +22,18 @@ FluScrollablePage{
|
|||||||
|
|
||||||
FluGroupBox {
|
FluGroupBox {
|
||||||
title: qsTr("RadioButton Group")
|
title: qsTr("RadioButton Group")
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.preferredHeight: 150
|
|
||||||
Layout.topMargin: 20
|
|
||||||
FluRadioButtons {
|
FluRadioButtons {
|
||||||
anchors{
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
left: parent.left
|
|
||||||
}
|
|
||||||
spacing: 10
|
spacing: 10
|
||||||
disabled: radio_button_switch.checked
|
|
||||||
FluRadioButton { text: qsTr("E-mail") }
|
FluRadioButton { text: qsTr("E-mail") }
|
||||||
FluRadioButton { text: qsTr("Calendar") }
|
FluRadioButton { text: qsTr("Calendar") }
|
||||||
FluRadioButton { text: qsTr("Contacts") }
|
FluRadioButton { text: qsTr("Contacts") }
|
||||||
}
|
}
|
||||||
|
|
||||||
FluToggleSwitch{
|
|
||||||
id: radio_button_switch
|
|
||||||
anchors{
|
|
||||||
right: parent.right
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
text: qsTr("Disabled")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CodeExpander{
|
CodeExpander{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 4
|
Layout.topMargin: 4
|
||||||
code:`
|
code:'FluGroupBox {
|
||||||
FluGroupBox {
|
|
||||||
title: qsTr("CheckBox Group")
|
title: qsTr("CheckBox Group")
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
spacing: 10
|
spacing: 10
|
||||||
@ -61,20 +42,7 @@ FluGroupBox {
|
|||||||
FluCheckBox { text: qsTr("Calendar") }
|
FluCheckBox { text: qsTr("Calendar") }
|
||||||
FluCheckBox { text: qsTr("Contacts") }
|
FluCheckBox { text: qsTr("Contacts") }
|
||||||
}
|
}
|
||||||
}
|
}'
|
||||||
|
|
||||||
FluGroupBox {
|
|
||||||
title: qsTr("RadioButton Group")
|
|
||||||
FluRadioButtons {
|
|
||||||
spacing: 10
|
|
||||||
disabled: true // 禁用所有FluRadioButton子组件
|
|
||||||
manuallyDisabled: true // 是否指定每个FluRadioButton上的disabled选项
|
|
||||||
FluRadioButton { text: qsTr("E-mail") }
|
|
||||||
FluRadioButton { text: qsTr("Calendar") }
|
|
||||||
FluRadioButton { text: qsTr("Contacts") }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -9,13 +9,9 @@ FluScrollablePage{
|
|||||||
|
|
||||||
title: qsTr("InfoBar")
|
title: qsTr("InfoBar")
|
||||||
|
|
||||||
property var info1
|
|
||||||
property var info2
|
|
||||||
property var info3
|
|
||||||
|
|
||||||
FluFrame{
|
FluFrame{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: 350
|
Layout.preferredHeight: 270
|
||||||
padding: 10
|
padding: 10
|
||||||
ColumnLayout{
|
ColumnLayout{
|
||||||
spacing: 14
|
spacing: 14
|
||||||
@ -53,51 +49,6 @@ FluScrollablePage{
|
|||||||
showInfo(qsTr("This is an InfoBar in the Info Style"),0,qsTr("Manual shutdown is supported"))
|
showInfo(qsTr("This is an InfoBar in the Info Style"),0,qsTr("Manual shutdown is supported"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FluText{
|
|
||||||
wrapMode: Text.WrapAnywhere
|
|
||||||
width: parent.width
|
|
||||||
text: qsTr("Manually close the info message box")
|
|
||||||
}
|
|
||||||
Row{
|
|
||||||
spacing: 5
|
|
||||||
FluButton{
|
|
||||||
text: (info1 ? qsTr("close '%1'") : qsTr("show '%1")).arg("info1")
|
|
||||||
onClicked: {
|
|
||||||
if(info1) {
|
|
||||||
info1.close()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
info1 = showInfo(qsTr("This is an '%1'").arg("info1"), 0)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FluButton{
|
|
||||||
text: (info2 ? qsTr("close '%1'") : qsTr("show '%1")).arg("info2")
|
|
||||||
onClicked: {
|
|
||||||
if(info2) {
|
|
||||||
info2.close()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
info2 = showInfo(qsTr("This is an '%1'").arg("info2"), 0)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FluButton{
|
|
||||||
text: (info3 ? qsTr("close '%1'") : qsTr("show '%1")).arg("info3")
|
|
||||||
onClicked: {
|
|
||||||
if(info3) {
|
|
||||||
info3.close()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
info3 = showInfo(qsTr("This is an '%1'").arg("info3"), 0)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FluButton{
|
|
||||||
text: qsTr("clear all info")
|
|
||||||
onClicked: {
|
|
||||||
clearAllInfo()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluButton{
|
FluButton{
|
||||||
text:"Loading"
|
text:"Loading"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
@ -109,17 +60,12 @@ FluScrollablePage{
|
|||||||
CodeExpander{
|
CodeExpander{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: -6
|
Layout.topMargin: -6
|
||||||
code:`
|
code:'showInfo(qsTr("This is an InfoBar in the Info Style"))
|
||||||
showInfo(qsTr("This is an InfoBar in the Info Style"))
|
|
||||||
|
|
||||||
showWarning(qsTr("This is an InfoBar in the Warning Style"))
|
showWarning(qsTr("This is an InfoBar in the Warning Style"))
|
||||||
|
|
||||||
showError(qsTr("This is an InfoBar in the Error Style"))
|
showError(qsTr("This is an InfoBar in the Error Style"))
|
||||||
|
|
||||||
showSuccess(qsTr("This is an InfoBar in the Success Style"))
|
showSuccess(qsTr("This is an InfoBar in the Success Style"))'
|
||||||
|
|
||||||
var info1 = showInfo(qsTr("This is an 'Info1'"), 0)
|
|
||||||
info1.close()
|
|
||||||
`
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,12 @@ void FluFrameless::componentComplete() {
|
|||||||
int w = window()->width();
|
int w = window()->width();
|
||||||
int h = window()->height();
|
int h = window()->height();
|
||||||
_current = window()->winId();
|
_current = window()->winId();
|
||||||
window()->setFlags((window()->flags()) | Qt::CustomizeWindowHint | Qt::WindowMinimizeButtonHint | Qt::WindowCloseButtonHint);
|
window()->setFlags((window()->flags()) | Qt::CustomizeWindowHint | Qt::WindowMinimizeButtonHint | Qt::WindowCloseButtonHint | Qt::FramelessWindowHint);
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
if (QQuickWindow::sceneGraphBackend() == "software") {
|
||||||
|
window()->setFlag(Qt::FramelessWindowHint, false);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (!_fixSize) {
|
if (!_fixSize) {
|
||||||
window()->setFlag(Qt::WindowMaximizeButtonHint);
|
window()->setFlag(Qt::WindowMaximizeButtonHint);
|
||||||
}
|
}
|
||||||
@ -92,14 +97,14 @@ void FluFrameless::componentComplete() {
|
|||||||
HWND hwnd = reinterpret_cast<HWND>(window()->winId());
|
HWND hwnd = reinterpret_cast<HWND>(window()->winId());
|
||||||
DWORD style = ::GetWindowLongPtr(hwnd, GWL_STYLE);
|
DWORD style = ::GetWindowLongPtr(hwnd, GWL_STYLE);
|
||||||
if (_fixSize) {
|
if (_fixSize) {
|
||||||
::SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_CAPTION);
|
::SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_THICKFRAME);
|
||||||
for (int i = 0; i <= QGuiApplication::screens().count() - 1; ++i) {
|
for (int i = 0; i <= QGuiApplication::screens().count() - 1; ++i) {
|
||||||
connect(QGuiApplication::screens().at(i), &QScreen::logicalDotsPerInchChanged, this, [=] {
|
connect(QGuiApplication::screens().at(i), &QScreen::logicalDotsPerInchChanged, this, [=] {
|
||||||
SetWindowPos(hwnd, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_FRAMECHANGED);
|
SetWindowPos(hwnd, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_FRAMECHANGED);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
::SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_MAXIMIZEBOX | WS_CAPTION);
|
::SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_MAXIMIZEBOX | WS_THICKFRAME);
|
||||||
}
|
}
|
||||||
SetWindowPos(hwnd, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
|
SetWindowPos(hwnd, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
|
||||||
connect(window(), &QQuickWindow::screenChanged, this, [hwnd] {
|
connect(window(), &QQuickWindow::screenChanged, this, [hwnd] {
|
||||||
@ -146,22 +151,29 @@ void FluFrameless::componentComplete() {
|
|||||||
return false;
|
return false;
|
||||||
} else if (uMsg == WM_NCCALCSIZE) {
|
} else if (uMsg == WM_NCCALCSIZE) {
|
||||||
const auto clientRect = ((wParam == FALSE) ? reinterpret_cast<LPRECT>(lParam) : &(reinterpret_cast<LPNCCALCSIZE_PARAMS>(lParam))->rgrc[0]);
|
const auto clientRect = ((wParam == FALSE) ? reinterpret_cast<LPRECT>(lParam) : &(reinterpret_cast<LPNCCALCSIZE_PARAMS>(lParam))->rgrc[0]);
|
||||||
bool isMaximum = ::IsZoomed(hwnd);
|
const LONG originalTop = clientRect->top;
|
||||||
if (!isMaximum){
|
const LONG originalLeft = clientRect->left;
|
||||||
if (clientRect->top != 0)
|
const LONG originalRight = clientRect->right;
|
||||||
{
|
const LONG originalBottom = clientRect->bottom;
|
||||||
clientRect->top -= 1;
|
const LRESULT hitTestResult = ::DefWindowProcW(hwnd, WM_NCCALCSIZE, wParam, lParam);
|
||||||
clientRect->bottom -= 1;
|
if ((hitTestResult != HTERROR) && (hitTestResult != HTNOWHERE)) {
|
||||||
}
|
*result = static_cast<QT_NATIVE_EVENT_RESULT_TYPE>(hitTestResult);
|
||||||
} else{
|
return true;
|
||||||
const LONG originalTop = clientRect->top;
|
|
||||||
const LRESULT hitTestResult = ::DefWindowProcW(hwnd, WM_NCCALCSIZE, wParam, lParam);
|
|
||||||
if ((hitTestResult != HTERROR) && (hitTestResult != HTNOWHERE)) {
|
|
||||||
*result = static_cast<QT_NATIVE_EVENT_RESULT_TYPE>(hitTestResult);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
clientRect->top = originalTop-originalTop;
|
|
||||||
}
|
}
|
||||||
|
int offsetSize;
|
||||||
|
bool isMaximum = ::IsZoomed(hwnd);
|
||||||
|
if (isMaximum || _isFullScreen()) {
|
||||||
|
offsetSize = 0;
|
||||||
|
} else {
|
||||||
|
offsetSize = 1;
|
||||||
|
}
|
||||||
|
if (!isCompositionEnabled()) {
|
||||||
|
offsetSize = 0;
|
||||||
|
}
|
||||||
|
clientRect->top = originalTop + offsetSize;
|
||||||
|
clientRect->bottom = originalBottom - offsetSize;
|
||||||
|
clientRect->left = originalLeft + offsetSize;
|
||||||
|
clientRect->right = originalRight - offsetSize;
|
||||||
_setMaximizeHovered(false);
|
_setMaximizeHovered(false);
|
||||||
*result = WVR_REDRAW;
|
*result = WVR_REDRAW;
|
||||||
return true;
|
return true;
|
||||||
@ -218,18 +230,6 @@ void FluFrameless::componentComplete() {
|
|||||||
}
|
}
|
||||||
*result = HTCLIENT;
|
*result = HTCLIENT;
|
||||||
return true;
|
return true;
|
||||||
} else if (uMsg == WM_NCPAINT) {
|
|
||||||
if(isCompositionEnabled()){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
*result = FALSE;
|
|
||||||
return true;
|
|
||||||
} else if (uMsg == WM_NCACTIVATE) {
|
|
||||||
if(isCompositionEnabled()){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
*result = TRUE;
|
|
||||||
return true;
|
|
||||||
} else if (_isWindows11OrGreater && (uMsg == WM_NCLBUTTONDBLCLK || uMsg == WM_NCLBUTTONDOWN)) {
|
} else if (_isWindows11OrGreater && (uMsg == WM_NCLBUTTONDBLCLK || uMsg == WM_NCLBUTTONDOWN)) {
|
||||||
if (_hitMaximizeButton()) {
|
if (_hitMaximizeButton()) {
|
||||||
QMouseEvent event = QMouseEvent(QEvent::MouseButtonPress, QPoint(), QPoint(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
|
QMouseEvent event = QMouseEvent(QEvent::MouseButtonPress, QPoint(), QPoint(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
|
||||||
@ -244,8 +244,23 @@ void FluFrameless::componentComplete() {
|
|||||||
_setMaximizePressed(false);
|
_setMaximizePressed(false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else if (uMsg == WM_ERASEBKGND) {
|
} else if (uMsg == WM_NCPAINT) {
|
||||||
|
*result = FALSE;
|
||||||
return true;
|
return true;
|
||||||
|
} else if (uMsg == WM_NCACTIVATE) {
|
||||||
|
*result = static_cast<QT_NATIVE_EVENT_RESULT_TYPE>(::DefWindowProcW(hwnd, WM_NCACTIVATE, wParam, -1));
|
||||||
|
return true;
|
||||||
|
} else if (uMsg == WM_GETMINMAXINFO) {
|
||||||
|
auto *minmaxInfo = reinterpret_cast<MINMAXINFO *>(lParam);
|
||||||
|
auto pixelRatio = window()->devicePixelRatio();
|
||||||
|
auto geometry = window()->screen()->availableGeometry();
|
||||||
|
RECT rect;
|
||||||
|
SystemParametersInfo(SPI_GETWORKAREA, 0, &rect, 0);
|
||||||
|
minmaxInfo->ptMaxPosition.x = rect.left;
|
||||||
|
minmaxInfo->ptMaxPosition.y = rect.top;
|
||||||
|
minmaxInfo->ptMaxSize.x = qRound(geometry.width() * pixelRatio);
|
||||||
|
minmaxInfo->ptMaxSize.y = qRound(geometry.height() * pixelRatio);
|
||||||
|
return false;
|
||||||
} else if (uMsg == WM_NCRBUTTONDOWN) {
|
} else if (uMsg == WM_NCRBUTTONDOWN) {
|
||||||
if (wParam == HTCAPTION) {
|
if (wParam == HTCAPTION) {
|
||||||
_showSystemMenu(QCursor::pos());
|
_showSystemMenu(QCursor::pos());
|
||||||
@ -343,27 +358,27 @@ void FluFrameless::_setMaximizeHovered(bool val) {
|
|||||||
|
|
||||||
void FluFrameless::_updateCursor(int edges) {
|
void FluFrameless::_updateCursor(int edges) {
|
||||||
switch (edges) {
|
switch (edges) {
|
||||||
case 0:
|
case 0:
|
||||||
window()->setCursor(Qt::ArrowCursor);
|
window()->setCursor(Qt::ArrowCursor);
|
||||||
break;
|
break;
|
||||||
case Qt::LeftEdge:
|
case Qt::LeftEdge:
|
||||||
case Qt::RightEdge:
|
case Qt::RightEdge:
|
||||||
window()->setCursor(Qt::SizeHorCursor);
|
window()->setCursor(Qt::SizeHorCursor);
|
||||||
break;
|
break;
|
||||||
case Qt::TopEdge:
|
case Qt::TopEdge:
|
||||||
case Qt::BottomEdge:
|
case Qt::BottomEdge:
|
||||||
window()->setCursor(Qt::SizeVerCursor);
|
window()->setCursor(Qt::SizeVerCursor);
|
||||||
break;
|
break;
|
||||||
case Qt::LeftEdge | Qt::TopEdge:
|
case Qt::LeftEdge | Qt::TopEdge:
|
||||||
case Qt::RightEdge | Qt::BottomEdge:
|
case Qt::RightEdge | Qt::BottomEdge:
|
||||||
window()->setCursor(Qt::SizeFDiagCursor);
|
window()->setCursor(Qt::SizeFDiagCursor);
|
||||||
break;
|
break;
|
||||||
case Qt::RightEdge | Qt::TopEdge:
|
case Qt::RightEdge | Qt::TopEdge:
|
||||||
case Qt::LeftEdge | Qt::BottomEdge:
|
case Qt::LeftEdge | Qt::BottomEdge:
|
||||||
window()->setCursor(Qt::SizeBDiagCursor);
|
window()->setCursor(Qt::SizeBDiagCursor);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,23 +18,22 @@ FluObject {
|
|||||||
if(screenLayout){
|
if(screenLayout){
|
||||||
var last = screenLayout.getLastloader();
|
var last = screenLayout.getLastloader();
|
||||||
if(last.type === type && last.text === text && moremsg === last.moremsg){
|
if(last.type === type && last.text === text && moremsg === last.moremsg){
|
||||||
last.duration = duration
|
last.restart();
|
||||||
if (duration > 0) last.restart();
|
return;
|
||||||
return last;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
initScreenLayout();
|
initScreenLayout();
|
||||||
return contentComponent.createObject(screenLayout,{
|
contentComponent.createObject(screenLayout,{
|
||||||
type:type,
|
type:type,
|
||||||
text:text,
|
text:text,
|
||||||
duration:duration,
|
duration:duration,
|
||||||
moremsg:moremsg,
|
moremsg:moremsg,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function createCustom(itemcomponent,duration){
|
function createCustom(itemcomponent,duration){
|
||||||
initScreenLayout();
|
initScreenLayout();
|
||||||
if(itemcomponent){
|
if(itemcomponent){
|
||||||
return contentComponent.createObject(screenLayout,{itemcomponent:itemcomponent,duration:duration});
|
contentComponent.createObject(screenLayout,{itemcomponent:itemcomponent,duration:duration});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function initScreenLayout(){
|
function initScreenLayout(){
|
||||||
@ -86,9 +85,7 @@ FluObject {
|
|||||||
}
|
}
|
||||||
Timer {
|
Timer {
|
||||||
id:delayTimer
|
id:delayTimer
|
||||||
interval: duration;
|
interval: duration; running: duration > 0; repeat: duration > 0
|
||||||
running: duration > 0;
|
|
||||||
repeat: duration > 0
|
|
||||||
onTriggered: content.close();
|
onTriggered: content.close();
|
||||||
}
|
}
|
||||||
FluLoader{
|
FluLoader{
|
||||||
@ -238,26 +235,18 @@ FluObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
function showSuccess(text,duration=1000,moremsg){
|
function showSuccess(text,duration=1000,moremsg){
|
||||||
return mcontrol.create(mcontrol.const_success,text,duration,moremsg ? moremsg : "");
|
mcontrol.create(mcontrol.const_success,text,duration,moremsg ? moremsg : "");
|
||||||
}
|
}
|
||||||
function showInfo(text,duration=1000,moremsg){
|
function showInfo(text,duration=1000,moremsg){
|
||||||
return mcontrol.create(mcontrol.const_info,text,duration,moremsg ? moremsg : "");
|
mcontrol.create(mcontrol.const_info,text,duration,moremsg ? moremsg : "");
|
||||||
}
|
}
|
||||||
function showWarning(text,duration=1000,moremsg){
|
function showWarning(text,duration=1000,moremsg){
|
||||||
return mcontrol.create(mcontrol.const_warning,text,duration,moremsg ? moremsg : "");
|
mcontrol.create(mcontrol.const_warning,text,duration,moremsg ? moremsg : "");
|
||||||
}
|
}
|
||||||
function showError(text,duration=1000,moremsg){
|
function showError(text,duration=1000,moremsg){
|
||||||
return mcontrol.create(mcontrol.const_error,text,duration,moremsg ? moremsg : "");
|
mcontrol.create(mcontrol.const_error,text,duration,moremsg ? moremsg : "");
|
||||||
}
|
}
|
||||||
function showCustom(itemcomponent,duration=1000){
|
function showCustom(itemcomponent,duration=1000){
|
||||||
return mcontrol.createCustom(itemcomponent,duration);
|
mcontrol.createCustom(itemcomponent,duration);
|
||||||
}
|
|
||||||
function clearAllInfo(){
|
|
||||||
if(mcontrol.screenLayout != null) {
|
|
||||||
mcontrol.screenLayout.destroy()
|
|
||||||
mcontrol.screenLayout = null
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,9 @@ T.MenuBarItem {
|
|||||||
radius: 3
|
radius: 3
|
||||||
color: {
|
color: {
|
||||||
if(control.highlighted){
|
if(control.highlighted){
|
||||||
|
return FluTheme.itemCheckColor
|
||||||
|
}
|
||||||
|
if(control.hovered){
|
||||||
return FluTheme.itemHoverColor
|
return FluTheme.itemHoverColor
|
||||||
}
|
}
|
||||||
return FluTheme.itemNormalColor
|
return FluTheme.itemNormalColor
|
||||||
|
@ -99,9 +99,9 @@ T.MenuItem {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: 3
|
anchors.margins: 3
|
||||||
radius: 4
|
radius: 4
|
||||||
color: {
|
color:{
|
||||||
if(control.highlighted){
|
if(control.highlighted){
|
||||||
return FluTheme.itemHoverColor
|
return FluTheme.itemCheckColor
|
||||||
}
|
}
|
||||||
return FluTheme.itemNormalColor
|
return FluTheme.itemNormalColor
|
||||||
}
|
}
|
||||||
|
@ -6,8 +6,6 @@ import FluentUI 1.0
|
|||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
default property alias buttons: control.data
|
default property alias buttons: control.data
|
||||||
property int currentIndex : -1
|
property int currentIndex : -1
|
||||||
property bool disabled: false
|
|
||||||
property bool manuallyDisabled: false
|
|
||||||
id:control
|
id:control
|
||||||
onCurrentIndexChanged: {
|
onCurrentIndexChanged: {
|
||||||
for(var i = 0;i<buttons.length;i++){
|
for(var i = 0;i<buttons.length;i++){
|
||||||
@ -18,12 +16,6 @@ ColumnLayout {
|
|||||||
button.checked = true
|
button.checked = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onDisabledChanged: {
|
|
||||||
refreshButtonStatus()
|
|
||||||
}
|
|
||||||
onManuallyDisabledChanged: {
|
|
||||||
refreshButtonStatus()
|
|
||||||
}
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
for(var i = 0;i<buttons.length;i++){
|
for(var i = 0;i<buttons.length;i++){
|
||||||
buttons[i].clickListener = function(){
|
buttons[i].clickListener = function(){
|
||||||
@ -35,12 +27,6 @@ ColumnLayout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
refreshButtonStatus()
|
currentIndex = 0
|
||||||
}
|
|
||||||
|
|
||||||
function refreshButtonStatus() {
|
|
||||||
for(var i = 0;i<buttons.length;i++){
|
|
||||||
if(!manuallyDisabled) buttons[i].enabled = !disabled
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -279,7 +279,13 @@ Window {
|
|||||||
id:loader_border
|
id:loader_border
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
sourceComponent: {
|
sourceComponent: {
|
||||||
if(window.useSystemAppBar || FluTools.isWin() || window.visibility === Window.Maximized || window.visibility === Window.FullScreen){
|
if(window.useSystemAppBar){
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
|
if(FluTools.isWindows10OrGreater()){
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
|
if(window.visibility === Window.Maximized || window.visibility === Window.FullScreen){
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
return com_border
|
return com_border
|
||||||
@ -289,19 +295,16 @@ Window {
|
|||||||
loader_loading.sourceComponent = undefined
|
loader_loading.sourceComponent = undefined
|
||||||
}
|
}
|
||||||
function showSuccess(text,duration,moremsg){
|
function showSuccess(text,duration,moremsg){
|
||||||
return info_bar.showSuccess(text,duration,moremsg)
|
info_bar.showSuccess(text,duration,moremsg)
|
||||||
}
|
}
|
||||||
function showInfo(text,duration,moremsg){
|
function showInfo(text,duration,moremsg){
|
||||||
return info_bar.showInfo(text,duration,moremsg)
|
info_bar.showInfo(text,duration,moremsg)
|
||||||
}
|
}
|
||||||
function showWarning(text,duration,moremsg){
|
function showWarning(text,duration,moremsg){
|
||||||
return info_bar.showWarning(text,duration,moremsg)
|
info_bar.showWarning(text,duration,moremsg)
|
||||||
}
|
}
|
||||||
function showError(text,duration,moremsg){
|
function showError(text,duration,moremsg){
|
||||||
return info_bar.showError(text,duration,moremsg)
|
info_bar.showError(text,duration,moremsg)
|
||||||
}
|
|
||||||
function clearAllInfo(){
|
|
||||||
return info_bar.clearAllInfo()
|
|
||||||
}
|
}
|
||||||
function moveWindowToDesktopCenter(){
|
function moveWindowToDesktopCenter(){
|
||||||
screen = Qt.application.screens[FluTools.cursorScreenIndex()]
|
screen = Qt.application.screens[FluTools.cursorScreenIndex()]
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls
|
||||||
import FluentUI 1.0
|
import FluentUI
|
||||||
|
|
||||||
FluObject {
|
FluObject {
|
||||||
property var root;
|
property var root;
|
||||||
@ -18,23 +18,22 @@ FluObject {
|
|||||||
if(screenLayout){
|
if(screenLayout){
|
||||||
var last = screenLayout.getLastloader();
|
var last = screenLayout.getLastloader();
|
||||||
if(last.type === type && last.text === text && moremsg === last.moremsg){
|
if(last.type === type && last.text === text && moremsg === last.moremsg){
|
||||||
last.duration = duration
|
last.restart();
|
||||||
if (duration > 0) last.restart();
|
return;
|
||||||
return last;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
initScreenLayout();
|
initScreenLayout();
|
||||||
return contentComponent.createObject(screenLayout,{
|
contentComponent.createObject(screenLayout,{
|
||||||
type:type,
|
type:type,
|
||||||
text:text,
|
text:text,
|
||||||
duration:duration,
|
duration:duration,
|
||||||
moremsg:moremsg,
|
moremsg:moremsg,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function createCustom(itemcomponent,duration){
|
function createCustom(itemcomponent,duration){
|
||||||
initScreenLayout();
|
initScreenLayout();
|
||||||
if(itemcomponent){
|
if(itemcomponent){
|
||||||
return contentComponent.createObject(screenLayout,{itemcomponent:itemcomponent,duration:duration});
|
contentComponent.createObject(screenLayout,{itemcomponent:itemcomponent,duration:duration});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function initScreenLayout(){
|
function initScreenLayout(){
|
||||||
@ -86,9 +85,7 @@ FluObject {
|
|||||||
}
|
}
|
||||||
Timer {
|
Timer {
|
||||||
id:delayTimer
|
id:delayTimer
|
||||||
interval: duration;
|
interval: duration; running: duration > 0; repeat: duration > 0
|
||||||
running: duration > 0;
|
|
||||||
repeat: duration > 0
|
|
||||||
onTriggered: content.close();
|
onTriggered: content.close();
|
||||||
}
|
}
|
||||||
FluLoader{
|
FluLoader{
|
||||||
@ -238,26 +235,18 @@ FluObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
function showSuccess(text,duration=1000,moremsg){
|
function showSuccess(text,duration=1000,moremsg){
|
||||||
return mcontrol.create(mcontrol.const_success,text,duration,moremsg ? moremsg : "");
|
mcontrol.create(mcontrol.const_success,text,duration,moremsg ? moremsg : "");
|
||||||
}
|
}
|
||||||
function showInfo(text,duration=1000,moremsg){
|
function showInfo(text,duration=1000,moremsg){
|
||||||
return mcontrol.create(mcontrol.const_info,text,duration,moremsg ? moremsg : "");
|
mcontrol.create(mcontrol.const_info,text,duration,moremsg ? moremsg : "");
|
||||||
}
|
}
|
||||||
function showWarning(text,duration=1000,moremsg){
|
function showWarning(text,duration=1000,moremsg){
|
||||||
return mcontrol.create(mcontrol.const_warning,text,duration,moremsg ? moremsg : "");
|
mcontrol.create(mcontrol.const_warning,text,duration,moremsg ? moremsg : "");
|
||||||
}
|
}
|
||||||
function showError(text,duration=1000,moremsg){
|
function showError(text,duration=1000,moremsg){
|
||||||
return mcontrol.create(mcontrol.const_error,text,duration,moremsg ? moremsg : "");
|
mcontrol.create(mcontrol.const_error,text,duration,moremsg ? moremsg : "");
|
||||||
}
|
}
|
||||||
function showCustom(itemcomponent,duration=1000){
|
function showCustom(itemcomponent,duration=1000){
|
||||||
return mcontrol.createCustom(itemcomponent,duration);
|
mcontrol.createCustom(itemcomponent,duration);
|
||||||
}
|
|
||||||
function clearAllInfo(){
|
|
||||||
if(mcontrol.screenLayout != null) {
|
|
||||||
mcontrol.screenLayout.destroy()
|
|
||||||
mcontrol.screenLayout = null
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,6 +49,9 @@ T.MenuBarItem {
|
|||||||
radius: 3
|
radius: 3
|
||||||
color: {
|
color: {
|
||||||
if(control.highlighted){
|
if(control.highlighted){
|
||||||
|
return FluTheme.itemCheckColor
|
||||||
|
}
|
||||||
|
if(control.hovered){
|
||||||
return FluTheme.itemHoverColor
|
return FluTheme.itemHoverColor
|
||||||
}
|
}
|
||||||
return FluTheme.itemNormalColor
|
return FluTheme.itemNormalColor
|
||||||
|
@ -100,9 +100,9 @@ T.MenuItem {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: 3
|
anchors.margins: 3
|
||||||
radius: 4
|
radius: 4
|
||||||
color: {
|
color:{
|
||||||
if(control.highlighted){
|
if(control.highlighted){
|
||||||
return FluTheme.itemHoverColor
|
return FluTheme.itemCheckColor
|
||||||
}
|
}
|
||||||
return FluTheme.itemNormalColor
|
return FluTheme.itemNormalColor
|
||||||
}
|
}
|
||||||
|
@ -7,8 +7,6 @@ import FluentUI
|
|||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
default property alias buttons: control.data
|
default property alias buttons: control.data
|
||||||
property int currentIndex : -1
|
property int currentIndex : -1
|
||||||
property bool disabled: false
|
|
||||||
property bool manuallyDisabled: false
|
|
||||||
id:control
|
id:control
|
||||||
onCurrentIndexChanged: {
|
onCurrentIndexChanged: {
|
||||||
for(var i = 0;i<buttons.length;i++){
|
for(var i = 0;i<buttons.length;i++){
|
||||||
@ -19,12 +17,6 @@ ColumnLayout {
|
|||||||
button.checked = true
|
button.checked = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onDisabledChanged: {
|
|
||||||
refreshButtonStatus()
|
|
||||||
}
|
|
||||||
onManuallyDisabledChanged: {
|
|
||||||
refreshButtonStatus()
|
|
||||||
}
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
for(var i = 0;i<buttons.length;i++){
|
for(var i = 0;i<buttons.length;i++){
|
||||||
buttons[i].clickListener = function(){
|
buttons[i].clickListener = function(){
|
||||||
@ -36,12 +28,6 @@ ColumnLayout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
refreshButtonStatus()
|
currentIndex = 0
|
||||||
}
|
|
||||||
|
|
||||||
function refreshButtonStatus() {
|
|
||||||
for(var i = 0;i<buttons.length;i++){
|
|
||||||
if(!manuallyDisabled) buttons[i].enabled = !disabled
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -278,7 +278,13 @@ Window {
|
|||||||
id:loader_border
|
id:loader_border
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
sourceComponent: {
|
sourceComponent: {
|
||||||
if(window.useSystemAppBar || FluTools.isWin() || window.visibility === Window.Maximized || window.visibility === Window.FullScreen){
|
if(window.useSystemAppBar){
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
|
if(FluTools.isWindows10OrGreater()){
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
|
if(window.visibility === Window.Maximized || window.visibility === Window.FullScreen){
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
return com_border
|
return com_border
|
||||||
@ -288,19 +294,16 @@ Window {
|
|||||||
loader_loading.sourceComponent = undefined
|
loader_loading.sourceComponent = undefined
|
||||||
}
|
}
|
||||||
function showSuccess(text,duration,moremsg){
|
function showSuccess(text,duration,moremsg){
|
||||||
return info_bar.showSuccess(text,duration,moremsg)
|
info_bar.showSuccess(text,duration,moremsg)
|
||||||
}
|
}
|
||||||
function showInfo(text,duration,moremsg){
|
function showInfo(text,duration,moremsg){
|
||||||
return info_bar.showInfo(text,duration,moremsg)
|
info_bar.showInfo(text,duration,moremsg)
|
||||||
}
|
}
|
||||||
function showWarning(text,duration,moremsg){
|
function showWarning(text,duration,moremsg){
|
||||||
return info_bar.showWarning(text,duration,moremsg)
|
info_bar.showWarning(text,duration,moremsg)
|
||||||
}
|
}
|
||||||
function showError(text,duration,moremsg){
|
function showError(text,duration,moremsg){
|
||||||
return info_bar.showError(text,duration,moremsg)
|
info_bar.showError(text,duration,moremsg)
|
||||||
}
|
|
||||||
function clearAllInfo(){
|
|
||||||
return info_bar.clearAllInfo()
|
|
||||||
}
|
}
|
||||||
function moveWindowToDesktopCenter(){
|
function moveWindowToDesktopCenter(){
|
||||||
screen = Qt.application.screens[FluTools.cursorScreenIndex()]
|
screen = Qt.application.screens[FluTools.cursorScreenIndex()]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user