Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI scaling improvements #1553

Merged
merged 7 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions qmlui/qml/ActionsMenu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ Popup
border.width: 1
border.color: UISettings.bgStronger
color: UISettings.bgStrong
height: actionsMenuEntries.height
}

Column
Expand Down Expand Up @@ -307,6 +308,7 @@ Popup
ContextMenuEntry
{
Layout.fillWidth: true
Layout.fillHeight: true
imgSource: "qrc:/undo.svg"
entryText: qsTr("Undo")
onEntered: submenuItem = null
Expand All @@ -320,6 +322,7 @@ Popup
ContextMenuEntry
{
Layout.fillWidth: true
Layout.fillHeight: true
imgSource: "qrc:/redo.svg"
entryText: qsTr("Redo")
onEntered: submenuItem = null
Expand Down
1 change: 1 addition & 0 deletions qmlui/qml/BeatGeneratorsPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ Rectangle
{
id: keyPadBox
width: parent.width
height: UISettings.iconSizeDefault * 6
showDMXcontrol: false
showTapButton: true
visible: ioManager.beatType === "INTERNAL"
Expand Down
8 changes: 4 additions & 4 deletions qmlui/qml/KeyPad.qml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Rectangle

property bool showDMXcontrol: true
property bool showTapButton: false

property alias commandString: commandBox.text
property real itemHeight: Math.max(UISettings.iconSizeDefault, keyPadRoot.height / keyPadGrid.rows) - 3

Expand Down Expand Up @@ -109,15 +109,15 @@ Rectangle
else
{
var currTime = new Date().getTime()

if (lastTap != 0 && currTime - lastTap < 1500)
{
var newTime = currTime - lastTap

tapHistory.push(newTime)

tapTimeValue = TimeUtils.calculateBPMByTapIntervals(tapHistory)

keyPadRoot.tapTimeChanged(tapTimeValue)
tapTimer.interval = tapTimeValue
tapTimer.restart()
Expand Down
21 changes: 16 additions & 5 deletions qmlui/qml/MainView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ Rectangle
MenuBarEntry
{
id: actEntry
Layout.alignment: Qt.AlignTop
imgSource: "qrc:/qlcplus.svg"
entryText: qsTr("Actions")
onPressed: actionsMenu.open()
Expand All @@ -165,6 +166,7 @@ Rectangle
{
id: fnfEntry
property string ctxName: "FIXANDFUNC"
Layout.alignment: Qt.AlignTop
property string ctxRes: "qrc:/FixturesAndFunctions.qml"

imgSource: "qrc:/editor.svg"
Expand All @@ -180,6 +182,7 @@ Rectangle
MenuBarEntry
{
id: vcEntry
Layout.alignment: Qt.AlignTop
property string ctxName: "VC"
property string ctxRes: "qrc:/VirtualConsole.qml"

Expand All @@ -201,6 +204,7 @@ Rectangle
MenuBarEntry
{
id: sdEntry
Layout.alignment: Qt.AlignTop
property string ctxName: "SDESK"
property string ctxRes: "qrc:/SimpleDesk.qml"

Expand All @@ -222,6 +226,7 @@ Rectangle
MenuBarEntry
{
id: smEntry
Layout.alignment: Qt.AlignTop
property string ctxName: "SHOWMGR"
property string ctxRes: "qrc:/ShowManager.qml"

Expand All @@ -243,6 +248,7 @@ Rectangle
MenuBarEntry
{
id: ioEntry
Layout.alignment: Qt.AlignTop
property string ctxName: "IOMGR"
property string ctxRes: "qrc:/InputOutputManager.qml"

Expand All @@ -265,14 +271,17 @@ Rectangle
{
// acts like an horizontal spacer
Layout.fillWidth: true
height: parent.height
implicitHeight: parent.height
color: "transparent"
}
RobotoText
{
label: "BPM: " + (ioManager.bpmNumber > 0 ? ioManager.bpmNumber : qsTr("Off"))
color: gsMouseArea.containsMouse ? UISettings.bgLight : "transparent"
fontSize: UISettings.textSizeDefault
Layout.alignment: Qt.AlignTop
implicitWidth: width
implicitHeight: parent.height

MouseArea
{
Expand All @@ -294,8 +303,9 @@ Rectangle
Rectangle
{
id: beatIndicator
width: height
height: parent.height * 0.5
implicitWidth: height
implicitHeight: parent.height * 0.5
Layout.alignment: Qt.AlignVCenter
radius: height / 2
border.width: 2
border.color: "#333"
Expand Down Expand Up @@ -324,8 +334,9 @@ Rectangle
IconButton
{
id: stopAllButton
width: UISettings.iconSizeDefault
height: UISettings.iconSizeDefault
implicitWidth: UISettings.iconSizeDefault
implicitHeight: UISettings.iconSizeDefault
Layout.alignment: Qt.AlignTop
enabled: runningCount ? true : false
bgColor: "transparent"
imgSource: "qrc:/stop.svg"
Expand Down
35 changes: 33 additions & 2 deletions qmlui/qml/UISettingsEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@ Rectangle
anchors.fill: parent
color: "transparent"

property real origItemHeight: UISettings.listItemHeight
property real origIconMedium: UISettings.iconSizeMedium
property real origItemHeight: { origItemHeight = UISettings.listItemHeight }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this syntax makes sense?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This syntax is meant to prevent a binding from being created on origItemHeight. To my knowledge this is the cleanest way to do this inline, although I'm open to being wrong

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH I've never seen that syntax before.
I'll merge this as it is. Thanks

property real origIconMedium: { origIconMedium = UISettings.iconSizeMedium }
property real origTextSizeDefault: { origTextSizeDefault = UISettings.textSizeDefault}
property real origIconDefault: {origIconDefault = UISettings.iconSizeDefault}

onVisibleChanged:
{
origItemHeight = UISettings.listItemHeight
origIconMedium = UISettings.iconSizeMedium
origTextSizeDefault = UISettings.textSizeDefault
sfRestore.origScaleFactor = qlcplus.uiScaleFactor
}

Expand Down Expand Up @@ -135,6 +138,7 @@ Rectangle
RobotoText
{
height: origItemHeight
fontSize: origTextSizeDefault
label: qsTr("Scaling factor")
}
RowLayout
Expand All @@ -153,6 +157,7 @@ Rectangle
RobotoText
{
height: origItemHeight
fontSize: origTextSizeDefault
label: sfSlider.value.toFixed(2) + "x"
}

Expand Down Expand Up @@ -181,6 +186,7 @@ Rectangle
RobotoText
{
height: origItemHeight
fontSize: origTextSizeDefault
label: qsTr("Background darker")
}
Loader
Expand All @@ -199,6 +205,7 @@ Rectangle
RobotoText
{
height: origItemHeight
fontSize: origTextSizeDefault
label: qsTr("Background dark")
}
Loader
Expand All @@ -218,6 +225,7 @@ Rectangle
RobotoText
{
height: origItemHeight
fontSize: origTextSizeDefault
label: qsTr("Background medium")
}
Loader
Expand All @@ -236,6 +244,7 @@ Rectangle
RobotoText
{
height: origItemHeight
fontSize: origTextSizeDefault
label: qsTr("Background light")
}
Loader
Expand All @@ -255,6 +264,7 @@ Rectangle
RobotoText
{
height: origItemHeight
fontSize: origTextSizeDefault
label: qsTr("Background lighter")
}
Loader
Expand All @@ -273,6 +283,7 @@ Rectangle
RobotoText
{
height: origItemHeight
fontSize: origTextSizeDefault
label: qsTr("Controls background")
}
Loader
Expand All @@ -292,6 +303,7 @@ Rectangle
RobotoText
{
height: origItemHeight
fontSize: origTextSizeDefault
label: qsTr("Foreground main")
}
Loader
Expand All @@ -310,6 +322,7 @@ Rectangle
RobotoText
{
height: origItemHeight
fontSize: origTextSizeDefault
label: qsTr("Foreground medium")
}
Loader
Expand All @@ -329,6 +342,7 @@ Rectangle
RobotoText
{
height: origItemHeight
fontSize: origTextSizeDefault
label: qsTr("Foreground light")
}
Loader
Expand All @@ -347,6 +361,7 @@ Rectangle
RobotoText
{
height: origItemHeight
fontSize: origTextSizeDefault
label: qsTr("Toolbar gradient start")
}
Loader
Expand All @@ -366,6 +381,7 @@ Rectangle
RobotoText
{
height: origItemHeight
fontSize: origTextSizeDefault
label: qsTr("Sub-toolbar gradient start")
}
Loader
Expand All @@ -384,6 +400,7 @@ Rectangle
RobotoText
{
height: origItemHeight
fontSize: origTextSizeDefault
label: qsTr("Toolbar gradient end")
}
Loader
Expand All @@ -403,6 +420,7 @@ Rectangle
RobotoText
{
height: origItemHeight
fontSize: origTextSizeDefault
label: qsTr("Toolbar hover gradient start")
}
Loader
Expand All @@ -422,6 +440,7 @@ Rectangle
RobotoText
{
height: origItemHeight
fontSize: origTextSizeDefault
label: qsTr("Toolbar hover gradient end")
}
Loader
Expand All @@ -441,6 +460,7 @@ Rectangle
RobotoText
{
height: origItemHeight
fontSize: origTextSizeDefault
label: qsTr("Toolbar selection")
}
Loader
Expand All @@ -460,6 +480,7 @@ Rectangle
RobotoText
{
height: origItemHeight
fontSize: origTextSizeDefault
label: qsTr("Sub-toolbar selection")
}
Loader
Expand All @@ -479,6 +500,7 @@ Rectangle
RobotoText
{
height: origItemHeight
fontSize: origTextSizeDefault
label: qsTr("Section header")
}
Loader
Expand All @@ -497,6 +519,7 @@ Rectangle
RobotoText
{
height: origItemHeight
fontSize: origTextSizeDefault
label: qsTr("Section header divider")
}
Loader
Expand All @@ -516,6 +539,7 @@ Rectangle
RobotoText
{
height: origItemHeight
fontSize: origTextSizeDefault
label: qsTr("Item highlight")
}
Loader
Expand All @@ -534,6 +558,7 @@ Rectangle
RobotoText
{
height: origItemHeight
fontSize: origTextSizeDefault
label: qsTr("Item highlight pressed")
}
Loader
Expand All @@ -553,6 +578,7 @@ Rectangle
RobotoText
{
height: origItemHeight
fontSize: origTextSizeDefault
label: qsTr("Item hover")
}
Loader
Expand All @@ -571,6 +597,7 @@ Rectangle
RobotoText
{
height: origItemHeight
fontSize: origTextSizeDefault
label: qsTr("Item selection")
}
Loader
Expand All @@ -590,6 +617,7 @@ Rectangle
RobotoText
{
height: origItemHeight
fontSize: origTextSizeDefault
label: qsTr("VC Frame drop area")
}
Loader
Expand All @@ -608,6 +636,7 @@ Rectangle
RobotoText
{
height: origItemHeight
fontSize: origTextSizeDefault
label: qsTr("Item dark border")
}
Loader
Expand All @@ -628,6 +657,8 @@ Rectangle
Layout.columnSpan: 4
Layout.alignment: Qt.AlignHCenter
width: origIconMedium * 10
height: origIconDefault
fontSize: origTextSizeDefault
label: qsTr("Save to file")
onClicked:
{
Expand Down
2 changes: 2 additions & 0 deletions qmlui/qml/popup/PopupAbout.qml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ CustomPopupDialog
" <a href='https://www.apache.org/licenses/LICENSE-2.0'>" +
qsTr("Apache 2.0 license") + "</a>."
onLinkActivated: Qt.openUrlExternally(link)
Layout.fillWidth: true
wrapMode: Text.WordWrap

MouseArea
{
Expand Down