Project: Improve Image visual quality and icon display.
This commit is contained in:
parent
40197a4387
commit
6cc04fbcb5
|
@ -22,6 +22,8 @@ RibbonWindow {
|
||||||
Image {
|
Image {
|
||||||
source: "qrc:/qt/qml/RibbonUI/resources/imgs/icon.png"
|
source: "qrc:/qt/qml/RibbonUI/resources/imgs/icon.png"
|
||||||
fillMode:Image.PreserveAspectFit
|
fillMode:Image.PreserveAspectFit
|
||||||
|
mipmap: true
|
||||||
|
autoTransform: true
|
||||||
Layout.preferredHeight: 120
|
Layout.preferredHeight: 120
|
||||||
Layout.preferredWidth: height
|
Layout.preferredWidth: height
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
|
|
@ -673,6 +673,8 @@ RibbonWindow {
|
||||||
Image {
|
Image {
|
||||||
source: "qrc:/qt/qml/RibbonUI/resources/imgs/icon.png"
|
source: "qrc:/qt/qml/RibbonUI/resources/imgs/icon.png"
|
||||||
fillMode:Image.PreserveAspectFit
|
fillMode:Image.PreserveAspectFit
|
||||||
|
mipmap: true
|
||||||
|
autoTransform: true
|
||||||
Layout.preferredHeight: 300
|
Layout.preferredHeight: 300
|
||||||
Layout.preferredWidth: height
|
Layout.preferredWidth: height
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
|
|
@ -23,6 +23,8 @@ RibbonWindow {
|
||||||
Image {
|
Image {
|
||||||
source: "qrc:/qt/qml/RibbonUI/resources/imgs/icon.png"
|
source: "qrc:/qt/qml/RibbonUI/resources/imgs/icon.png"
|
||||||
fillMode:Image.PreserveAspectFit
|
fillMode:Image.PreserveAspectFit
|
||||||
|
mipmap: true
|
||||||
|
autoTransform: true
|
||||||
Layout.preferredHeight: 120
|
Layout.preferredHeight: 120
|
||||||
Layout.preferredWidth: height
|
Layout.preferredWidth: height
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
|
|
@ -673,6 +673,8 @@ RibbonWindow {
|
||||||
Image {
|
Image {
|
||||||
source: "qrc:/qt/qml/RibbonUI/resources/imgs/icon.png"
|
source: "qrc:/qt/qml/RibbonUI/resources/imgs/icon.png"
|
||||||
fillMode:Image.PreserveAspectFit
|
fillMode:Image.PreserveAspectFit
|
||||||
|
mipmap: true
|
||||||
|
autoTransform: true
|
||||||
Layout.preferredHeight: 300
|
Layout.preferredHeight: 300
|
||||||
Layout.preferredWidth: height
|
Layout.preferredWidth: height
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
|
|
@ -206,7 +206,7 @@ Popup {
|
||||||
id :rib_icon
|
id :rib_icon
|
||||||
iconSource: typeof(model.menu_icon) === "number" ? model.menu_icon : 0
|
iconSource: typeof(model.menu_icon) === "number" ? model.menu_icon : 0
|
||||||
iconSourceFilled: typeof(model.menu_icon_filled) === "number" ? model.menu_icon_filled : iconSource
|
iconSourceFilled: typeof(model.menu_icon_filled) === "number" ? model.menu_icon_filled : iconSource
|
||||||
iconSize: menu_label.contentHeight
|
iconSize: menu_label.visible ? menu_label.contentHeight : 16
|
||||||
visible: typeof(model.menu_icon) === "number" && model.menu_icon
|
visible: typeof(model.menu_icon) === "number" && model.menu_icon
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
filled: item_bg.view.currentIndex === index && item_bg.isCurrentMenu
|
filled: item_bg.view.currentIndex === index && item_bg.isCurrentMenu
|
||||||
|
@ -217,7 +217,9 @@ Popup {
|
||||||
source: typeof(model.menu_icon) === "string" ? model.menu_icon : ""
|
source: typeof(model.menu_icon) === "string" ? model.menu_icon : ""
|
||||||
visible: typeof(model.menu_icon) === "string"
|
visible: typeof(model.menu_icon) === "string"
|
||||||
fillMode:Image.PreserveAspectFit
|
fillMode:Image.PreserveAspectFit
|
||||||
height: menu_label.contentHeight
|
mipmap: true
|
||||||
|
autoTransform: true
|
||||||
|
height: menu_label.visible ? menu_label.contentHeight : 16
|
||||||
width: height
|
width: height
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
}
|
}
|
||||||
|
@ -231,6 +233,7 @@ Popup {
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
font.family: Qt.platform.os === "osx" ? "PingFang SC" : "Microsoft YaHei UI"
|
font.family: Qt.platform.os === "osx" ? "PingFang SC" : "Microsoft YaHei UI"
|
||||||
renderType: RibbonTheme.nativeText ? Text.NativeRendering : Text.QtRendering
|
renderType: RibbonTheme.nativeText ? Text.NativeRendering : Text.QtRendering
|
||||||
|
visible: text
|
||||||
Layout.preferredWidth: {
|
Layout.preferredWidth: {
|
||||||
let w = 0
|
let w = 0
|
||||||
w += rib_icon.visible ? rib_icon.contentWidth : 0
|
w += rib_icon.visible ? rib_icon.contentWidth : 0
|
||||||
|
|
|
@ -99,6 +99,8 @@ Button {
|
||||||
source: typeof(root.iconSource) === "string" ? root.iconSource : ""
|
source: typeof(root.iconSource) === "string" ? root.iconSource : ""
|
||||||
visible: typeof(root.iconSource) === "string"
|
visible: typeof(root.iconSource) === "string"
|
||||||
fillMode:Image.PreserveAspectFit
|
fillMode:Image.PreserveAspectFit
|
||||||
|
mipmap: true
|
||||||
|
autoTransform: true
|
||||||
height: label.visible ? label.contentHeight : 16
|
height: label.visible ? label.contentHeight : 16
|
||||||
width: height
|
width: height
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
|
|
@ -68,7 +68,7 @@ MenuItem {
|
||||||
id :rib_icon
|
id :rib_icon
|
||||||
iconSource: typeof(control.iconSource) === "number" ? control.iconSource : 0
|
iconSource: typeof(control.iconSource) === "number" ? control.iconSource : 0
|
||||||
iconSourceFilled: typeof(control.iconSourceFilled) === "number" ? control.iconSourceFilled : iconSource
|
iconSourceFilled: typeof(control.iconSourceFilled) === "number" ? control.iconSourceFilled : iconSource
|
||||||
iconSize: label.contentHeight
|
iconSize: label.visible ? label.contentHeight : 16
|
||||||
visible: typeof(control.iconSource) === "number" && control.iconSource
|
visible: typeof(control.iconSource) === "number" && control.iconSource
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
filled: pressed || checked
|
filled: pressed || checked
|
||||||
|
@ -79,7 +79,9 @@ MenuItem {
|
||||||
source: typeof(control.iconSource) === "string" ? control.iconSource : ""
|
source: typeof(control.iconSource) === "string" ? control.iconSource : ""
|
||||||
visible: typeof(control.iconSource) === "string"
|
visible: typeof(control.iconSource) === "string"
|
||||||
fillMode:Image.PreserveAspectFit
|
fillMode:Image.PreserveAspectFit
|
||||||
height: label.contentHeight
|
mipmap: true
|
||||||
|
autoTransform: true
|
||||||
|
height: label.visible ? label.contentHeight : 16
|
||||||
width: height
|
width: height
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
}
|
}
|
||||||
|
@ -93,6 +95,7 @@ MenuItem {
|
||||||
font.family: Qt.platform.os === "osx" ? "PingFang SC" : "Microsoft YaHei UI"
|
font.family: Qt.platform.os === "osx" ? "PingFang SC" : "Microsoft YaHei UI"
|
||||||
color: textColor
|
color: textColor
|
||||||
renderType: RibbonTheme.nativeText ? Text.NativeRendering : Text.QtRendering
|
renderType: RibbonTheme.nativeText ? Text.NativeRendering : Text.QtRendering
|
||||||
|
visible: text
|
||||||
Layout.preferredWidth:{
|
Layout.preferredWidth:{
|
||||||
let w = 0
|
let w = 0
|
||||||
w += rib_icon.visible ? rib_icon.contentWidth : 0
|
w += rib_icon.visible ? rib_icon.contentWidth : 0
|
||||||
|
|
|
@ -62,6 +62,8 @@ Item {
|
||||||
source: typeof(root.iconSource) === "string" ? root.iconSource : ""
|
source: typeof(root.iconSource) === "string" ? root.iconSource : ""
|
||||||
visible: typeof(root.iconSource) === "string"
|
visible: typeof(root.iconSource) === "string"
|
||||||
fillMode:Image.PreserveAspectFit
|
fillMode:Image.PreserveAspectFit
|
||||||
|
mipmap: true
|
||||||
|
autoTransform: true
|
||||||
height: left.height
|
height: left.height
|
||||||
width: height
|
width: height
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
|
|
@ -56,7 +56,7 @@ Item {
|
||||||
iconSourceFilled: typeof(control.titleIconSourceFilled) === "number" ? control.titleIconSourceFilled : iconSource
|
iconSourceFilled: typeof(control.titleIconSourceFilled) === "number" ? control.titleIconSourceFilled : iconSource
|
||||||
iconSize: title_text.contentHeight
|
iconSize: title_text.contentHeight
|
||||||
visible: typeof(control.titleIconSource) === "number"
|
visible: typeof(control.titleIconSource) === "number"
|
||||||
Layout.preferredHeight: title_text.contentHeight
|
Layout.preferredHeight: title_text.visible ? title_text.contentHeight : 16
|
||||||
Layout.preferredWidth: Layout.preferredHeight
|
Layout.preferredWidth: Layout.preferredHeight
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
filled: mouse.pressed
|
filled: mouse.pressed
|
||||||
|
@ -82,7 +82,9 @@ Item {
|
||||||
source: typeof(control.titleIconSource) === "string" ? control.titleIconSource : ""
|
source: typeof(control.titleIconSource) === "string" ? control.titleIconSource : ""
|
||||||
visible: typeof(control.titleIconSource) === "string"
|
visible: typeof(control.titleIconSource) === "string"
|
||||||
fillMode:Image.PreserveAspectFit
|
fillMode:Image.PreserveAspectFit
|
||||||
Layout.preferredHeight: title_text.contentHeight
|
mipmap: true
|
||||||
|
autoTransform: true
|
||||||
|
Layout.preferredHeight: title_text.visible ? title_text.contentHeight : 16
|
||||||
Layout.preferredWidth: Layout.preferredHeight
|
Layout.preferredWidth: Layout.preferredHeight
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
}
|
}
|
||||||
|
@ -93,6 +95,7 @@ Item {
|
||||||
color: titleTextColor
|
color: titleTextColor
|
||||||
renderType: RibbonTheme.nativeText ? Text.NativeRendering : Text.QtRendering
|
renderType: RibbonTheme.nativeText ? Text.NativeRendering : Text.QtRendering
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
visible: text
|
||||||
Behavior on color {
|
Behavior on color {
|
||||||
ColorAnimation {
|
ColorAnimation {
|
||||||
duration: 60
|
duration: 60
|
||||||
|
|
|
@ -206,7 +206,7 @@ Popup {
|
||||||
id :rib_icon
|
id :rib_icon
|
||||||
iconSource: typeof(model.menu_icon) === "number" ? model.menu_icon : 0
|
iconSource: typeof(model.menu_icon) === "number" ? model.menu_icon : 0
|
||||||
iconSourceFilled: typeof(model.menu_icon_filled) === "number" ? model.menu_icon_filled : iconSource
|
iconSourceFilled: typeof(model.menu_icon_filled) === "number" ? model.menu_icon_filled : iconSource
|
||||||
iconSize: menu_label.contentHeight
|
iconSize: menu_label.visible ? menu_label.contentHeight : 16
|
||||||
visible: typeof(model.menu_icon) === "number" && model.menu_icon
|
visible: typeof(model.menu_icon) === "number" && model.menu_icon
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
filled: item_bg.view.currentIndex === index && item_bg.isCurrentMenu
|
filled: item_bg.view.currentIndex === index && item_bg.isCurrentMenu
|
||||||
|
@ -217,7 +217,9 @@ Popup {
|
||||||
source: typeof(model.menu_icon) === "string" ? model.menu_icon : ""
|
source: typeof(model.menu_icon) === "string" ? model.menu_icon : ""
|
||||||
visible: typeof(model.menu_icon) === "string"
|
visible: typeof(model.menu_icon) === "string"
|
||||||
fillMode:Image.PreserveAspectFit
|
fillMode:Image.PreserveAspectFit
|
||||||
height: menu_label.contentHeight
|
mipmap: true
|
||||||
|
autoTransform: true
|
||||||
|
height: menu_label.visible ? menu_label.contentHeight : 16
|
||||||
width: height
|
width: height
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
}
|
}
|
||||||
|
@ -231,6 +233,7 @@ Popup {
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
font.family: Qt.platform.os === "osx" ? "PingFang SC" : "Microsoft YaHei UI"
|
font.family: Qt.platform.os === "osx" ? "PingFang SC" : "Microsoft YaHei UI"
|
||||||
renderType: RibbonTheme.nativeText ? Text.NativeRendering : Text.QtRendering
|
renderType: RibbonTheme.nativeText ? Text.NativeRendering : Text.QtRendering
|
||||||
|
visible: text
|
||||||
Layout.preferredWidth: {
|
Layout.preferredWidth: {
|
||||||
let w = 0
|
let w = 0
|
||||||
w += rib_icon.visible ? rib_icon.contentWidth : 0
|
w += rib_icon.visible ? rib_icon.contentWidth : 0
|
||||||
|
|
|
@ -99,6 +99,8 @@ Button {
|
||||||
source: typeof(root.iconSource) === "string" ? root.iconSource : ""
|
source: typeof(root.iconSource) === "string" ? root.iconSource : ""
|
||||||
visible: typeof(root.iconSource) === "string"
|
visible: typeof(root.iconSource) === "string"
|
||||||
fillMode:Image.PreserveAspectFit
|
fillMode:Image.PreserveAspectFit
|
||||||
|
mipmap: true
|
||||||
|
autoTransform: true
|
||||||
height: label.visible ? label.contentHeight : 16
|
height: label.visible ? label.contentHeight : 16
|
||||||
width: height
|
width: height
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
|
|
@ -68,7 +68,7 @@ MenuItem {
|
||||||
id :rib_icon
|
id :rib_icon
|
||||||
iconSource: typeof(control.iconSource) === "number" ? control.iconSource : 0
|
iconSource: typeof(control.iconSource) === "number" ? control.iconSource : 0
|
||||||
iconSourceFilled: typeof(control.iconSourceFilled) === "number" ? control.iconSourceFilled : iconSource
|
iconSourceFilled: typeof(control.iconSourceFilled) === "number" ? control.iconSourceFilled : iconSource
|
||||||
iconSize: label.contentHeight
|
iconSize: label.visible ? label.contentHeight : 16
|
||||||
visible: typeof(control.iconSource) === "number" && control.iconSource
|
visible: typeof(control.iconSource) === "number" && control.iconSource
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
filled: pressed || checked
|
filled: pressed || checked
|
||||||
|
@ -79,7 +79,9 @@ MenuItem {
|
||||||
source: typeof(control.iconSource) === "string" ? control.iconSource : ""
|
source: typeof(control.iconSource) === "string" ? control.iconSource : ""
|
||||||
visible: typeof(control.iconSource) === "string"
|
visible: typeof(control.iconSource) === "string"
|
||||||
fillMode:Image.PreserveAspectFit
|
fillMode:Image.PreserveAspectFit
|
||||||
height: label.contentHeight
|
mipmap: true
|
||||||
|
autoTransform: true
|
||||||
|
height: label.visible ? label.contentHeight : 16
|
||||||
width: height
|
width: height
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
}
|
}
|
||||||
|
@ -93,6 +95,7 @@ MenuItem {
|
||||||
font.family: Qt.platform.os === "osx" ? "PingFang SC" : "Microsoft YaHei UI"
|
font.family: Qt.platform.os === "osx" ? "PingFang SC" : "Microsoft YaHei UI"
|
||||||
color: textColor
|
color: textColor
|
||||||
renderType: RibbonTheme.nativeText ? Text.NativeRendering : Text.QtRendering
|
renderType: RibbonTheme.nativeText ? Text.NativeRendering : Text.QtRendering
|
||||||
|
visible: text
|
||||||
Layout.preferredWidth:{
|
Layout.preferredWidth:{
|
||||||
let w = 0
|
let w = 0
|
||||||
w += rib_icon.visible ? rib_icon.contentWidth : 0
|
w += rib_icon.visible ? rib_icon.contentWidth : 0
|
||||||
|
|
|
@ -62,6 +62,8 @@ Item {
|
||||||
source: typeof(root.iconSource) === "string" ? root.iconSource : ""
|
source: typeof(root.iconSource) === "string" ? root.iconSource : ""
|
||||||
visible: typeof(root.iconSource) === "string"
|
visible: typeof(root.iconSource) === "string"
|
||||||
fillMode:Image.PreserveAspectFit
|
fillMode:Image.PreserveAspectFit
|
||||||
|
mipmap: true
|
||||||
|
autoTransform: true
|
||||||
height: left.height
|
height: left.height
|
||||||
width: height
|
width: height
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
|
|
@ -56,7 +56,7 @@ Item {
|
||||||
iconSourceFilled: typeof(control.titleIconSourceFilled) === "number" ? control.titleIconSourceFilled : iconSource
|
iconSourceFilled: typeof(control.titleIconSourceFilled) === "number" ? control.titleIconSourceFilled : iconSource
|
||||||
iconSize: title_text.contentHeight
|
iconSize: title_text.contentHeight
|
||||||
visible: typeof(control.titleIconSource) === "number"
|
visible: typeof(control.titleIconSource) === "number"
|
||||||
Layout.preferredHeight: title_text.contentHeight
|
Layout.preferredHeight: title_text.visible ? title_text.contentHeight : 16
|
||||||
Layout.preferredWidth: Layout.preferredHeight
|
Layout.preferredWidth: Layout.preferredHeight
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
filled: mouse.pressed
|
filled: mouse.pressed
|
||||||
|
@ -82,7 +82,9 @@ Item {
|
||||||
source: typeof(control.titleIconSource) === "string" ? control.titleIconSource : ""
|
source: typeof(control.titleIconSource) === "string" ? control.titleIconSource : ""
|
||||||
visible: typeof(control.titleIconSource) === "string"
|
visible: typeof(control.titleIconSource) === "string"
|
||||||
fillMode:Image.PreserveAspectFit
|
fillMode:Image.PreserveAspectFit
|
||||||
Layout.preferredHeight: title_text.contentHeight
|
mipmap: true
|
||||||
|
autoTransform: true
|
||||||
|
Layout.preferredHeight: title_text.visible ? title_text.contentHeight : 16
|
||||||
Layout.preferredWidth: Layout.preferredHeight
|
Layout.preferredWidth: Layout.preferredHeight
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
}
|
}
|
||||||
|
@ -93,6 +95,7 @@ Item {
|
||||||
color: titleTextColor
|
color: titleTextColor
|
||||||
renderType: RibbonTheme.nativeText ? Text.NativeRendering : Text.QtRendering
|
renderType: RibbonTheme.nativeText ? Text.NativeRendering : Text.QtRendering
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
visible: text
|
||||||
Behavior on color {
|
Behavior on color {
|
||||||
ColorAnimation {
|
ColorAnimation {
|
||||||
duration: 60
|
duration: 60
|
||||||
|
|
Loading…
Reference in New Issue