mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-03 08:35:28 +08:00
update
This commit is contained in:
@ -16,6 +16,7 @@ public:
|
||||
|
||||
FramelessView::FramelessView(QWindow *parent) : Super(parent), d(new FramelessViewPrivate)
|
||||
{
|
||||
setResizeMode(SizeRootObjectToView);
|
||||
refreshWindow();
|
||||
setIsMax(windowState() == Qt::WindowMaximized);
|
||||
setIsFull(windowState() == Qt::WindowFullScreen);
|
||||
@ -35,8 +36,6 @@ void FramelessView::refreshWindow(){
|
||||
}else{
|
||||
setFlags(Qt::Window);
|
||||
}
|
||||
setResizeMode(SizeViewToRootObject);
|
||||
setResizeMode(SizeRootObjectToView);
|
||||
}
|
||||
|
||||
FramelessView::~FramelessView()
|
||||
@ -123,6 +122,17 @@ bool FramelessView::nativeEvent(const QByteArray &eventType, void *message, qint
|
||||
bool FramelessView::nativeEvent(const QByteArray &eventType, void *message, long *result)
|
||||
#endif
|
||||
{
|
||||
MSG* msg = static_cast<MSG*>(message);
|
||||
if (msg->message == WM_WINDOWPOSCHANGING)
|
||||
{
|
||||
WINDOWPOS* wp = reinterpret_cast<WINDOWPOS*>(msg->lParam);
|
||||
if (wp != nullptr && (wp->flags & SWP_NOSIZE) == 0)
|
||||
{
|
||||
wp->flags |= SWP_NOCOPYBITS;
|
||||
*result = 0;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return Super::nativeEvent(eventType, message, result);
|
||||
}
|
||||
|
||||
|
@ -18,14 +18,17 @@ Item {
|
||||
property color borderNormalColor: FluTheme.isDark ? Qt.rgba(160/255,160/255,160/255,1) : Qt.rgba(136/255,136/255,136/255,1)
|
||||
property color borderCheckedColor: FluTheme.isDark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||
property color borderHoverColor: FluTheme.isDark ? Qt.rgba(167/255,167/255,167/255,1) : Qt.rgba(135/255,135/255,135/255,1)
|
||||
|
||||
property color borderDisableColor: FluTheme.isDark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(199/255,199/255,199/255,1)
|
||||
|
||||
property color normalColor: FluTheme.isDark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(247/255,247/255,247/255,1)
|
||||
property color checkedColor: FluTheme.isDark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||
property color hoverColor: FluTheme.isDark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(244/255,244/255,244/255,1)
|
||||
|
||||
property color checkedHoverColor: FluTheme.isDark ? Qt.darker(checkedColor,1.1) : Qt.lighter(checkedColor,1.1)
|
||||
|
||||
property color checkedDisableColor: FluTheme.isDark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(199/255,199/255,199/255,1)
|
||||
|
||||
property color disableColor: FluTheme.isDark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(253/255,253/255,253/255,1)
|
||||
|
||||
RowLayout{
|
||||
spacing: 4
|
||||
Rectangle{
|
||||
@ -33,6 +36,9 @@ Item {
|
||||
height: 22
|
||||
radius: 4
|
||||
border.color: {
|
||||
if(disabled){
|
||||
return borderDisableColor
|
||||
}
|
||||
if(checked){
|
||||
return borderCheckedColor
|
||||
}
|
||||
@ -44,6 +50,9 @@ Item {
|
||||
border.width: 1
|
||||
color: {
|
||||
if(checked){
|
||||
if(disabled){
|
||||
return checkedDisableColor
|
||||
}
|
||||
if(hovered){
|
||||
return checkedHoverColor
|
||||
}
|
||||
|
Reference in New Issue
Block a user