Skip to content

Commit

Permalink
wrap scrolling text to avoid blank at end of string
Browse files Browse the repository at this point in the history
  • Loading branch information
kwindrem committed Oct 16, 2023
1 parent c77fca4 commit 8341b62
Show file tree
Hide file tree
Showing 738 changed files with 27,431 additions and 27,569 deletions.
71 changes: 71 additions & 0 deletions FileSets/MarqueeEnhanced.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
////// add bold
import QtQuick 1.1

Rectangle {
id: marquee

height: _text.paintedHeight + 5
clip: true
color: "transparent"

property alias text: _text.text
property alias interval: marqueeTimer.interval
property alias fontSize: _text.font.pixelSize
property alias textColor: _text.color
property variant textHorizontalAlignment: Text.AlignHCenter
property alias bold: _text.font.bold
property bool scroll: true
property bool longName: text != "" && _text.paintedWidth > marquee.width

function doScroll()
{
if (longName)
marqueeTimer.running = true
}

Text {
id: _text
font.pixelSize: 13
color: "#fff"
width: parent.width
anchors.verticalCenter: parent.verticalCenter
// use spcified alignment unless name won't fit or are scrolling, then align left
horizontalAlignment: textHorizontalAlignment
visible: ! longName
}

// double incoming text so the scroll fills in past the end of the string
Text {
id: _textToDisplay
text: _text.text + "..." + _text.text
font.pixelSize: 13
color: "#fff"
width: parent.width
anchors.verticalCenter: parent.verticalCenter
// use spcified alignment unless name won't fit or are scrolling, then align left
horizontalAlignment: marqueeTimer.running ? Text.AlignLeft : textHorizontalAlignment
visible: longName
}


Timer {
id: marqueeTimer
interval: 100
repeat: true
running: _text.paintedWidth > marquee.width && scroll
onTriggered: moveText()
onRunningChanged: if (!running) _textToDisplay.x = 0
}

function moveText()
{
if (_textToDisplay.x + _text.paintedWidth <= 2)
{
_textToDisplay.x = 0 ////marquee.width
if (! scroll)
marqueeTimer.running = false
}
else
_textToDisplay.x -= 2
}
}
1 change: 0 additions & 1 deletion FileSets/MarqueeEnhanced.qml.ALT_ORIG

This file was deleted.

File renamed without changes.
1 change: 0 additions & 1 deletion FileSets/TileTankEnhanced.qml.ALT_ORIG

This file was deleted.

3 changes: 0 additions & 3 deletions FileSets/fileList
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
/opt/victronenergy/gui/qml/ObjectAcConnection.qml
/opt/victronenergy/gui/qml/OverviewHubEnhanced.qml
/opt/victronenergy/gui/qml/OverviewMobileEnhanced.qml
/opt/victronenergy/gui/qml/TileTankEnhanced.qml
/opt/victronenergy/gui/qml/MarqueeEnhanced.qml
/opt/victronenergy/gui/qml/HubData.qml
/opt/victronenergy/gui/qml/PageSettingsDisplay.qml
/opt/victronenergy/gui/qml/Tile.qml
/opt/victronenergy/gui/qml/PageSettingsRelay.qml
/opt/victronenergy/gui/qml/PageSettingsGuiMods.qml
/opt/victronenergy/gui/qml/TileRelay.qml
Expand Down
1 change: 0 additions & 1 deletion FileSets/v2.71/MarqueeEnhanced.qml

This file was deleted.

2 changes: 1 addition & 1 deletion FileSets/v2.71/MbEditBox.qml
2 changes: 1 addition & 1 deletion FileSets/v2.71/MbEditBoxDateTime.qml
2 changes: 1 addition & 1 deletion FileSets/v2.71/MbSubMenu.qml
2 changes: 1 addition & 1 deletion FileSets/v2.71/Multi.qml
2 changes: 1 addition & 1 deletion FileSets/v2.71/OverviewBox.qml
2 changes: 1 addition & 1 deletion FileSets/v2.71/OverviewConnection.qml
2 changes: 1 addition & 1 deletion FileSets/v2.71/OverviewConnectionEnd.qml
2 changes: 1 addition & 1 deletion FileSets/v2.71/OverviewSolarCharger.qml
2 changes: 1 addition & 1 deletion FileSets/v2.71/OverviewTankDelegate.qml
2 changes: 1 addition & 1 deletion FileSets/v2.71/OverviewTanks.qml
1 change: 0 additions & 1 deletion FileSets/v2.71/TileTankEnhanced.qml

This file was deleted.

2 changes: 1 addition & 1 deletion FileSets/v2.71/TileText.qml
2 changes: 1 addition & 1 deletion FileSets/v2.71/styles.css
1 change: 0 additions & 1 deletion FileSets/v2.72/MarqueeEnhanced.qml

This file was deleted.

2 changes: 1 addition & 1 deletion FileSets/v2.72/MbEditBox.qml
2 changes: 1 addition & 1 deletion FileSets/v2.72/MbEditBoxDateTime.qml
2 changes: 1 addition & 1 deletion FileSets/v2.72/MbSubMenu.qml
2 changes: 1 addition & 1 deletion FileSets/v2.72/Multi.qml
2 changes: 1 addition & 1 deletion FileSets/v2.72/OverviewBox.qml
2 changes: 1 addition & 1 deletion FileSets/v2.72/OverviewConnection.qml
2 changes: 1 addition & 1 deletion FileSets/v2.72/OverviewConnectionEnd.qml
2 changes: 1 addition & 1 deletion FileSets/v2.72/OverviewSolarCharger.qml
2 changes: 1 addition & 1 deletion FileSets/v2.72/OverviewTankDelegate.qml
2 changes: 1 addition & 1 deletion FileSets/v2.72/OverviewTanks.qml
1 change: 0 additions & 1 deletion FileSets/v2.72/TileTankEnhanced.qml

This file was deleted.

2 changes: 1 addition & 1 deletion FileSets/v2.72/TileText.qml
2 changes: 1 addition & 1 deletion FileSets/v2.72/styles.css
1 change: 0 additions & 1 deletion FileSets/v2.73/MarqueeEnhanced.qml

This file was deleted.

2 changes: 1 addition & 1 deletion FileSets/v2.73/MbEditBox.qml
2 changes: 1 addition & 1 deletion FileSets/v2.73/MbEditBoxDateTime.qml
2 changes: 1 addition & 1 deletion FileSets/v2.73/MbSubMenu.qml
2 changes: 1 addition & 1 deletion FileSets/v2.73/Multi.qml
2 changes: 1 addition & 1 deletion FileSets/v2.73/OverviewBox.qml
2 changes: 1 addition & 1 deletion FileSets/v2.73/OverviewConnection.qml
2 changes: 1 addition & 1 deletion FileSets/v2.73/OverviewConnectionEnd.qml
2 changes: 1 addition & 1 deletion FileSets/v2.73/OverviewSolarCharger.qml
2 changes: 1 addition & 1 deletion FileSets/v2.73/OverviewTankDelegate.qml
2 changes: 1 addition & 1 deletion FileSets/v2.73/OverviewTanks.qml
1 change: 0 additions & 1 deletion FileSets/v2.73/TileTankEnhanced.qml

This file was deleted.

2 changes: 1 addition & 1 deletion FileSets/v2.73/TileText.qml
2 changes: 1 addition & 1 deletion FileSets/v2.73/styles.css
1 change: 0 additions & 1 deletion FileSets/v2.80/MarqueeEnhanced.qml

This file was deleted.

2 changes: 1 addition & 1 deletion FileSets/v2.80/MbEditBox.qml
2 changes: 1 addition & 1 deletion FileSets/v2.80/MbEditBoxDateTime.qml
2 changes: 1 addition & 1 deletion FileSets/v2.80/MbSubMenu.qml
2 changes: 1 addition & 1 deletion FileSets/v2.80/Multi.qml
2 changes: 1 addition & 1 deletion FileSets/v2.80/OverviewBox.qml
2 changes: 1 addition & 1 deletion FileSets/v2.80/OverviewConnection.qml
2 changes: 1 addition & 1 deletion FileSets/v2.80/OverviewConnectionEnd.qml
2 changes: 1 addition & 1 deletion FileSets/v2.80/OverviewSolarCharger.qml
2 changes: 1 addition & 1 deletion FileSets/v2.80/OverviewTankDelegate.qml
2 changes: 1 addition & 1 deletion FileSets/v2.80/OverviewTanks.qml
1 change: 0 additions & 1 deletion FileSets/v2.80/TileTankEnhanced.qml

This file was deleted.

2 changes: 1 addition & 1 deletion FileSets/v2.80/TileText.qml
2 changes: 1 addition & 1 deletion FileSets/v2.80/styles.css
1 change: 0 additions & 1 deletion FileSets/v2.81/MarqueeEnhanced.qml

This file was deleted.

2 changes: 1 addition & 1 deletion FileSets/v2.81/MbEditBox.qml
2 changes: 1 addition & 1 deletion FileSets/v2.81/MbEditBoxDateTime.qml
2 changes: 1 addition & 1 deletion FileSets/v2.81/MbSubMenu.qml
2 changes: 1 addition & 1 deletion FileSets/v2.81/Multi.qml
2 changes: 1 addition & 1 deletion FileSets/v2.81/OverviewBox.qml
2 changes: 1 addition & 1 deletion FileSets/v2.81/OverviewConnection.qml
2 changes: 1 addition & 1 deletion FileSets/v2.81/OverviewConnectionEnd.qml
2 changes: 1 addition & 1 deletion FileSets/v2.81/OverviewSolarCharger.qml
2 changes: 1 addition & 1 deletion FileSets/v2.81/OverviewTankDelegate.qml
Loading

0 comments on commit 8341b62

Please sign in to comment.