ActiveWindow+MediaMini: auto min & max width
This commit is contained in:
parent
5e23476089
commit
4455074493
2 changed files with 6 additions and 4 deletions
|
|
@ -33,8 +33,9 @@ RowLayout {
|
||||||
|
|
||||||
readonly property bool showIcon: (widgetSettings.showIcon !== undefined) ? widgetSettings.showIcon : widgetMetadata.showIcon
|
readonly property bool showIcon: (widgetSettings.showIcon !== undefined) ? widgetSettings.showIcon : widgetMetadata.showIcon
|
||||||
|
|
||||||
readonly property real minWidth: 160
|
// 5% of total width
|
||||||
readonly property real maxWidth: 400
|
readonly property real minWidth: Math.max(1, screen.width * 0.05)
|
||||||
|
readonly property real maxWidth: minWidth * 2
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
spacing: Style.marginS * scaling
|
spacing: Style.marginS * scaling
|
||||||
visible: getTitle() !== ""
|
visible: getTitle() !== ""
|
||||||
|
|
|
||||||
|
|
@ -38,8 +38,9 @@ RowLayout {
|
||||||
readonly property string visualizerType: (widgetSettings.visualizerType !== undefined && widgetSettings.visualizerType
|
readonly property string visualizerType: (widgetSettings.visualizerType !== undefined && widgetSettings.visualizerType
|
||||||
!== "") ? widgetSettings.visualizerType : widgetMetadata.visualizerType
|
!== "") ? widgetSettings.visualizerType : widgetMetadata.visualizerType
|
||||||
|
|
||||||
readonly property real minWidth: 160
|
// 5% of total width
|
||||||
readonly property real maxWidth: 400
|
readonly property real minWidth: Math.max(1, screen.width * 0.05)
|
||||||
|
readonly property real maxWidth: minWidth * 2
|
||||||
|
|
||||||
function getTitle() {
|
function getTitle() {
|
||||||
return MediaService.trackTitle + (MediaService.trackArtist !== "" ? ` - ${MediaService.trackArtist}` : "")
|
return MediaService.trackTitle + (MediaService.trackArtist !== "" ? ` - ${MediaService.trackArtist}` : "")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue