Compare commits
No commits in common. "1a48510a1b6a742ee6ff8fb88414197f675c71d6" and "c53aa3b9278bba5ec7d8092818e45002415c9f73" have entirely different histories.
1a48510a1b
...
c53aa3b927
|
@ -16,9 +16,8 @@ RibbonWindow {
|
||||||
id: msg_bar
|
id: msg_bar
|
||||||
implicitWidth: windowItems.width
|
implicitWidth: windowItems.width
|
||||||
x: windowItems.x
|
x: windowItems.x
|
||||||
y: titleBar.height + tab_bar.y + tab_bar.height - tab_bar.modernMargin + msg_bar.topMargin
|
y: titleBar.height + tab_bar.y + tab_bar.height - tab_bar.modernMargin + (RibbonTheme.modernStyle ? 5 : 0)
|
||||||
target: windowItems
|
target: windowItems
|
||||||
targetRect: Qt.rect(tab_bar.x,y,width,height)
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
messageModel.append([{
|
messageModel.append([{
|
||||||
type: RibbonMessageBar.Info,
|
type: RibbonMessageBar.Info,
|
||||||
|
@ -60,6 +59,7 @@ RibbonWindow {
|
||||||
externalURL: "https://github.com/mentalfl0w/RibbonUI",
|
externalURL: "https://github.com/mentalfl0w/RibbonUI",
|
||||||
externalURLLabel: "Visit our website."
|
externalURLLabel: "Visit our website."
|
||||||
}])
|
}])
|
||||||
|
messageBar.showMessage(RibbonMessageBar.Info, "test")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,6 +157,7 @@ RibbonWindow {
|
||||||
pageWidth: (page_slider.value / 100.0) * width
|
pageWidth: (page_slider.value / 100.0) * width
|
||||||
spacing: 0
|
spacing: 0
|
||||||
isMainView: true
|
isMainView: true
|
||||||
|
topBorderFix: msg_bar.folded ? msg_bar.barHeight : 0
|
||||||
ColumnLayout{
|
ColumnLayout{
|
||||||
Layout.alignment: Qt.AlignCenter
|
Layout.alignment: Qt.AlignCenter
|
||||||
Layout.topMargin: 30
|
Layout.topMargin: 30
|
||||||
|
|
|
@ -16,9 +16,8 @@ RibbonWindow {
|
||||||
id: msg_bar
|
id: msg_bar
|
||||||
implicitWidth: windowItems.width
|
implicitWidth: windowItems.width
|
||||||
x: windowItems.x
|
x: windowItems.x
|
||||||
y: titleBar.height + tab_bar.y + tab_bar.height - tab_bar.modernMargin + msg_bar.topMargin
|
y: titleBar.height + tab_bar.y + tab_bar.height - tab_bar.modernMargin + (RibbonTheme.modernStyle ? 5 : 0)
|
||||||
target: windowItems
|
target: windowItems
|
||||||
targetRect: Qt.rect(tab_bar.x,y,width,height)
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
messageModel.append([{
|
messageModel.append([{
|
||||||
type: RibbonMessageBar.Info,
|
type: RibbonMessageBar.Info,
|
||||||
|
@ -60,6 +59,7 @@ RibbonWindow {
|
||||||
externalURL: "https://github.com/mentalfl0w/RibbonUI",
|
externalURL: "https://github.com/mentalfl0w/RibbonUI",
|
||||||
externalURLLabel: "Visit our website."
|
externalURLLabel: "Visit our website."
|
||||||
}])
|
}])
|
||||||
|
messageBar.showMessage(RibbonMessageBar.Info, "test")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,6 +157,7 @@ RibbonWindow {
|
||||||
pageWidth: (page_slider.value / 100.0) * width
|
pageWidth: (page_slider.value / 100.0) * width
|
||||||
spacing: 0
|
spacing: 0
|
||||||
isMainView: true
|
isMainView: true
|
||||||
|
topBorderFix: msg_bar.folded ? msg_bar.barHeight : 0
|
||||||
ColumnLayout{
|
ColumnLayout{
|
||||||
Layout.alignment: Qt.AlignCenter
|
Layout.alignment: Qt.AlignCenter
|
||||||
Layout.topMargin: 30
|
Layout.topMargin: 30
|
||||||
|
|
|
@ -19,7 +19,7 @@ RibbonRectangle {
|
||||||
id: effect
|
id: effect
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
sourceRect: control.targetRect
|
sourceRect: control.targetRect
|
||||||
visible: false
|
visible: !enableEffect
|
||||||
}
|
}
|
||||||
|
|
||||||
GaussianBlur{
|
GaussianBlur{
|
||||||
|
|
|
@ -7,9 +7,9 @@ RibbonBlur {
|
||||||
id: control
|
id: control
|
||||||
parent: Overlay.overlay
|
parent: Overlay.overlay
|
||||||
implicitWidth: parent.width
|
implicitWidth: parent.width
|
||||||
|
useSolidBg: true
|
||||||
implicitHeight: 30
|
implicitHeight: 30
|
||||||
maskColor: folded && !handler.visible ? "transparent" : RibbonTheme.isDarkMode ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1)
|
maskColor: folded ? "transparent" : RibbonTheme.isDarkMode ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1)
|
||||||
maskOpacity: 0
|
|
||||||
bottomLeftRadius: folded ? 0 : 5
|
bottomLeftRadius: folded ? 0 : 5
|
||||||
bottomRightRadius: bottomLeftRadius
|
bottomRightRadius: bottomLeftRadius
|
||||||
enableEffect: handler.visible || !folded
|
enableEffect: handler.visible || !folded
|
||||||
|
@ -17,11 +17,10 @@ RibbonBlur {
|
||||||
property int animationTime: 400
|
property int animationTime: 400
|
||||||
property real barHeight: implicitHeight - handler.height
|
property real barHeight: implicitHeight - handler.height
|
||||||
property alias messageModel: messageModel
|
property alias messageModel: messageModel
|
||||||
property real topMargin: RibbonTheme.modernStyle ? 5 : 0
|
|
||||||
|
|
||||||
Behavior on implicitHeight {
|
Behavior on implicitHeight {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: control.animationTime
|
duration: control.animationTime / 2
|
||||||
easing.type: Easing.OutSine
|
easing.type: Easing.OutSine
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,13 +30,13 @@ RibbonBlur {
|
||||||
onCountChanged: {
|
onCountChanged: {
|
||||||
message_list.currentIndex = count ? count - 1 : 0
|
message_list.currentIndex = count ? count - 1 : 0
|
||||||
if(count === 0)
|
if(count === 0)
|
||||||
clearMessages()
|
folded_btn.checked = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer{
|
Timer{
|
||||||
id: auto_scroll_btn_timer
|
id: auto_scroll_btn_timer
|
||||||
interval: control.animationTime * 2
|
interval: control.animationTime
|
||||||
repeat: false
|
repeat: false
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
message_list.positionViewAtIndex(message_list.currentIndex, ListView.Center)
|
message_list.positionViewAtIndex(message_list.currentIndex, ListView.Center)
|
||||||
|
@ -120,7 +119,7 @@ RibbonBlur {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
properties: "y"
|
properties: "y"
|
||||||
from: message_list.height
|
from: message_list.height
|
||||||
duration: control.animationTime
|
duration: control.animationTime / 2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
remove: Transition {
|
remove: Transition {
|
||||||
|
@ -128,7 +127,7 @@ RibbonBlur {
|
||||||
property: "opacity"
|
property: "opacity"
|
||||||
from: 1
|
from: 1
|
||||||
to: 0
|
to: 0
|
||||||
duration: control.animationTime
|
duration: control.animationTime / 2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ScrollBar.vertical: RibbonScrollBar {
|
ScrollBar.vertical: RibbonScrollBar {
|
||||||
|
@ -141,7 +140,7 @@ RibbonBlur {
|
||||||
}
|
}
|
||||||
Behavior on height {
|
Behavior on height {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: control.animationTime
|
duration: control.animationTime / 2
|
||||||
easing.type: Easing.OutSine
|
easing.type: Easing.OutSine
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -155,13 +154,17 @@ RibbonBlur {
|
||||||
id: handler
|
id: handler
|
||||||
x: message_list.x + (message_list.width - width) / 2
|
x: message_list.x + (message_list.width - width) / 2
|
||||||
y: message_list.y + message_list.height * (folded ? 1 : 0)
|
y: message_list.y + message_list.height * (folded ? 1 : 0)
|
||||||
implicitHeight: folded ? 10 : 20
|
implicitHeight: 20
|
||||||
implicitWidth: parent.width
|
implicitWidth: parent.width
|
||||||
|
topLeftRadius: folded ? 0 : 10
|
||||||
|
topRightRadius: topLeftRadius
|
||||||
|
bottomLeftRadius: folded ? 10 : 0
|
||||||
|
bottomRightRadius: bottomLeftRadius
|
||||||
visible: hover.hovered && messageModel.count
|
visible: hover.hovered && messageModel.count
|
||||||
color: RibbonTheme.isDarkMode ? Qt.rgba(0,0,0,0.5) : Qt.rgba(1,1,1,0.5)
|
color: RibbonTheme.isDarkMode ? Qt.rgba(0,0,0,0.5) : Qt.rgba(1,1,1,0.5)
|
||||||
Behavior on color {
|
Behavior on color {
|
||||||
ColorAnimation {
|
ColorAnimation {
|
||||||
duration: control.animationTime
|
duration: control.animationTime / 2
|
||||||
easing.type: Easing.OutSine
|
easing.type: Easing.OutSine
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -173,7 +176,6 @@ RibbonBlur {
|
||||||
showBg: false
|
showBg: false
|
||||||
showHoveredBg: false
|
showHoveredBg: false
|
||||||
iconSource: RibbonIcons.DismissCircle
|
iconSource: RibbonIcons.DismissCircle
|
||||||
ribbonIcon.iconSize: handler.implicitHeight - 2
|
|
||||||
tipText: qsTr("Clear All")
|
tipText: qsTr("Clear All")
|
||||||
onClicked: clearMessages()
|
onClicked: clearMessages()
|
||||||
visible: !folded
|
visible: !folded
|
||||||
|
@ -184,7 +186,6 @@ RibbonBlur {
|
||||||
checkable: true
|
checkable: true
|
||||||
showBg: false
|
showBg: false
|
||||||
showHoveredBg: false
|
showHoveredBg: false
|
||||||
ribbonIcon.iconSize: handler.implicitHeight - 2
|
|
||||||
iconSource: RibbonIcons.TriangleDown
|
iconSource: RibbonIcons.TriangleDown
|
||||||
rotation: checked ? 0 : 180
|
rotation: checked ? 0 : 180
|
||||||
checked: true
|
checked: true
|
||||||
|
@ -240,7 +241,6 @@ RibbonBlur {
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearMessages(){
|
function clearMessages(){
|
||||||
folded_btn.checked = true
|
|
||||||
messageModel.clear()
|
messageModel.clear()
|
||||||
implicitHeight = 0
|
implicitHeight = 0
|
||||||
barHeight = 0
|
barHeight = 0
|
||||||
|
|
|
@ -34,16 +34,7 @@ Item {
|
||||||
right: parent.right
|
right: parent.right
|
||||||
top: parent.top
|
top: parent.top
|
||||||
}
|
}
|
||||||
height: {
|
height: (isMainView ? Window.window ? Window.window.tabBar ? Math.abs(Window.window.tabBar.height - Window.window.tabBar.modernMargin) : 0 : 0 : 0) + topBorderFix
|
||||||
var w = topBorderFix
|
|
||||||
if(isMainView && Window.window){
|
|
||||||
if(Window.window.tabBar)
|
|
||||||
w += Math.abs(Window.window.tabBar.height - Window.window.tabBar.modernMargin)
|
|
||||||
if(Window.window.messageBar)
|
|
||||||
w += (Window.window.messageBar.folded ? Window.window.messageBar.barHeight + Window.window.messageBar.topMargin : 0)
|
|
||||||
}
|
|
||||||
return w
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Item{
|
Item{
|
||||||
|
@ -71,14 +62,7 @@ Item {
|
||||||
right: parent.right
|
right: parent.right
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
}
|
}
|
||||||
height: {
|
height: (isMainView ? Window.window ? Window.window.tabBar ? Math.abs(Window.window.bottomBar.height) : 0 : 0 : 0) + bottomBorderFix
|
||||||
var w = bottomBorderFix
|
|
||||||
if(isMainView && Window.window){
|
|
||||||
if(Window.window.bottomBar)
|
|
||||||
w += Math.abs(Window.window.bottomBar.height)
|
|
||||||
}
|
|
||||||
return w
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
|
|
|
@ -19,7 +19,7 @@ RibbonRectangle {
|
||||||
id: effect
|
id: effect
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
sourceRect: control.targetRect
|
sourceRect: control.targetRect
|
||||||
visible: false
|
visible: !enableEffect
|
||||||
}
|
}
|
||||||
|
|
||||||
GaussianBlur{
|
GaussianBlur{
|
||||||
|
|
|
@ -7,9 +7,9 @@ RibbonBlur {
|
||||||
id: control
|
id: control
|
||||||
parent: Overlay.overlay
|
parent: Overlay.overlay
|
||||||
implicitWidth: parent.width
|
implicitWidth: parent.width
|
||||||
|
useSolidBg: true
|
||||||
implicitHeight: 30
|
implicitHeight: 30
|
||||||
maskColor: folded && !handler.visible ? "transparent" : RibbonTheme.isDarkMode ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1)
|
maskColor: folded ? "transparent" : RibbonTheme.isDarkMode ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1)
|
||||||
maskOpacity: 0
|
|
||||||
bottomLeftRadius: folded ? 0 : 5
|
bottomLeftRadius: folded ? 0 : 5
|
||||||
bottomRightRadius: bottomLeftRadius
|
bottomRightRadius: bottomLeftRadius
|
||||||
enableEffect: handler.visible || !folded
|
enableEffect: handler.visible || !folded
|
||||||
|
@ -17,11 +17,10 @@ RibbonBlur {
|
||||||
property int animationTime: 400
|
property int animationTime: 400
|
||||||
property real barHeight: implicitHeight - handler.height
|
property real barHeight: implicitHeight - handler.height
|
||||||
property alias messageModel: messageModel
|
property alias messageModel: messageModel
|
||||||
property real topMargin: RibbonTheme.modernStyle ? 5 : 0
|
|
||||||
|
|
||||||
Behavior on implicitHeight {
|
Behavior on implicitHeight {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: control.animationTime
|
duration: control.animationTime / 2
|
||||||
easing.type: Easing.OutSine
|
easing.type: Easing.OutSine
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,13 +30,13 @@ RibbonBlur {
|
||||||
onCountChanged: {
|
onCountChanged: {
|
||||||
message_list.currentIndex = count ? count - 1 : 0
|
message_list.currentIndex = count ? count - 1 : 0
|
||||||
if(count === 0)
|
if(count === 0)
|
||||||
clearMessages()
|
folded_btn.checked = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer{
|
Timer{
|
||||||
id: auto_scroll_btn_timer
|
id: auto_scroll_btn_timer
|
||||||
interval: control.animationTime * 2
|
interval: control.animationTime
|
||||||
repeat: false
|
repeat: false
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
message_list.positionViewAtIndex(message_list.currentIndex, ListView.Center)
|
message_list.positionViewAtIndex(message_list.currentIndex, ListView.Center)
|
||||||
|
@ -120,7 +119,7 @@ RibbonBlur {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
properties: "y"
|
properties: "y"
|
||||||
from: message_list.height
|
from: message_list.height
|
||||||
duration: control.animationTime
|
duration: control.animationTime / 2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
remove: Transition {
|
remove: Transition {
|
||||||
|
@ -128,7 +127,7 @@ RibbonBlur {
|
||||||
property: "opacity"
|
property: "opacity"
|
||||||
from: 1
|
from: 1
|
||||||
to: 0
|
to: 0
|
||||||
duration: control.animationTime
|
duration: control.animationTime / 2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ScrollBar.vertical: RibbonScrollBar {
|
ScrollBar.vertical: RibbonScrollBar {
|
||||||
|
@ -141,7 +140,7 @@ RibbonBlur {
|
||||||
}
|
}
|
||||||
Behavior on height {
|
Behavior on height {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: control.animationTime
|
duration: control.animationTime / 2
|
||||||
easing.type: Easing.OutSine
|
easing.type: Easing.OutSine
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -155,13 +154,17 @@ RibbonBlur {
|
||||||
id: handler
|
id: handler
|
||||||
x: message_list.x + (message_list.width - width) / 2
|
x: message_list.x + (message_list.width - width) / 2
|
||||||
y: message_list.y + message_list.height * (folded ? 1 : 0)
|
y: message_list.y + message_list.height * (folded ? 1 : 0)
|
||||||
implicitHeight: folded ? 10 : 20
|
implicitHeight: 20
|
||||||
implicitWidth: parent.width
|
implicitWidth: parent.width
|
||||||
|
topLeftRadius: folded ? 0 : 10
|
||||||
|
topRightRadius: topLeftRadius
|
||||||
|
bottomLeftRadius: folded ? 10 : 0
|
||||||
|
bottomRightRadius: bottomLeftRadius
|
||||||
visible: hover.hovered && messageModel.count
|
visible: hover.hovered && messageModel.count
|
||||||
color: RibbonTheme.isDarkMode ? Qt.rgba(0,0,0,0.5) : Qt.rgba(1,1,1,0.5)
|
color: RibbonTheme.isDarkMode ? Qt.rgba(0,0,0,0.5) : Qt.rgba(1,1,1,0.5)
|
||||||
Behavior on color {
|
Behavior on color {
|
||||||
ColorAnimation {
|
ColorAnimation {
|
||||||
duration: control.animationTime
|
duration: control.animationTime / 2
|
||||||
easing.type: Easing.OutSine
|
easing.type: Easing.OutSine
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -173,7 +176,6 @@ RibbonBlur {
|
||||||
showBg: false
|
showBg: false
|
||||||
showHoveredBg: false
|
showHoveredBg: false
|
||||||
iconSource: RibbonIcons.DismissCircle
|
iconSource: RibbonIcons.DismissCircle
|
||||||
ribbonIcon.iconSize: handler.implicitHeight - 2
|
|
||||||
tipText: qsTr("Clear All")
|
tipText: qsTr("Clear All")
|
||||||
onClicked: clearMessages()
|
onClicked: clearMessages()
|
||||||
visible: !folded
|
visible: !folded
|
||||||
|
@ -184,7 +186,6 @@ RibbonBlur {
|
||||||
checkable: true
|
checkable: true
|
||||||
showBg: false
|
showBg: false
|
||||||
showHoveredBg: false
|
showHoveredBg: false
|
||||||
ribbonIcon.iconSize: handler.implicitHeight - 2
|
|
||||||
iconSource: RibbonIcons.TriangleDown
|
iconSource: RibbonIcons.TriangleDown
|
||||||
rotation: checked ? 0 : 180
|
rotation: checked ? 0 : 180
|
||||||
checked: true
|
checked: true
|
||||||
|
@ -240,7 +241,6 @@ RibbonBlur {
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearMessages(){
|
function clearMessages(){
|
||||||
folded_btn.checked = true
|
|
||||||
messageModel.clear()
|
messageModel.clear()
|
||||||
implicitHeight = 0
|
implicitHeight = 0
|
||||||
barHeight = 0
|
barHeight = 0
|
||||||
|
|
|
@ -34,16 +34,7 @@ Item {
|
||||||
right: parent.right
|
right: parent.right
|
||||||
top: parent.top
|
top: parent.top
|
||||||
}
|
}
|
||||||
height: {
|
height: (isMainView ? Window.window ? Window.window.tabBar ? Math.abs(Window.window.tabBar.height - Window.window.tabBar.modernMargin) : 0 : 0 : 0) + topBorderFix
|
||||||
var w = topBorderFix
|
|
||||||
if(isMainView && Window.window){
|
|
||||||
if(Window.window.tabBar)
|
|
||||||
w += Math.abs(Window.window.tabBar.height - Window.window.tabBar.modernMargin)
|
|
||||||
if(Window.window.messageBar)
|
|
||||||
w += (Window.window.messageBar.folded ? Window.window.messageBar.barHeight + Window.window.messageBar.topMargin : 0)
|
|
||||||
}
|
|
||||||
return w
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Item{
|
Item{
|
||||||
|
@ -71,14 +62,7 @@ Item {
|
||||||
right: parent.right
|
right: parent.right
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
}
|
}
|
||||||
height: {
|
height: (isMainView ? Window.window ? Window.window.tabBar ? Math.abs(Window.window.bottomBar.height) : 0 : 0 : 0) + bottomBorderFix
|
||||||
var w = bottomBorderFix
|
|
||||||
if(isMainView && Window.window){
|
|
||||||
if(Window.window.bottomBar)
|
|
||||||
w += Math.abs(Window.window.bottomBar.height)
|
|
||||||
}
|
|
||||||
return w
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
|
|
Loading…
Reference in New Issue