mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-30 00:12:50 -05:00
media: fix padding issues with long titles
This commit is contained in:
@@ -539,10 +539,38 @@ func (m *Manager) getDeadlineNormal(now time.Time, sched sunSchedule) time.Time
|
|||||||
case now.Before(times.Night):
|
case now.Before(times.Night):
|
||||||
return now.Add(sched.nightStepTime)
|
return now.Add(sched.nightStepTime)
|
||||||
default:
|
default:
|
||||||
return m.tomorrow(now)
|
return m.tomorrowDawn(now)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *Manager) tomorrowDawn(now time.Time) time.Time {
|
||||||
|
tomorrow := time.Date(now.Year(), now.Month(), now.Day()+1, 0, 0, 0, 0, now.Location())
|
||||||
|
|
||||||
|
m.configMutex.RLock()
|
||||||
|
config := m.config
|
||||||
|
m.configMutex.RUnlock()
|
||||||
|
|
||||||
|
if config.ManualSunrise != nil {
|
||||||
|
dur := time.Hour
|
||||||
|
if config.ManualDuration != nil {
|
||||||
|
dur = *config.ManualDuration
|
||||||
|
}
|
||||||
|
return time.Date(tomorrow.Year(), tomorrow.Month(), tomorrow.Day(),
|
||||||
|
config.ManualSunrise.Hour(), config.ManualSunrise.Minute(), config.ManualSunrise.Second(), 0, tomorrow.Location()).Add(-dur)
|
||||||
|
}
|
||||||
|
|
||||||
|
lat, lon := m.getLocation()
|
||||||
|
if lat == nil || lon == nil {
|
||||||
|
return tomorrow
|
||||||
|
}
|
||||||
|
|
||||||
|
times, cond := CalculateSunTimesWithTwilight(*lat, *lon, tomorrow, config.ElevationTwilight, config.ElevationDaylight)
|
||||||
|
if cond != SunNormal {
|
||||||
|
return tomorrow
|
||||||
|
}
|
||||||
|
return times.Dawn
|
||||||
|
}
|
||||||
|
|
||||||
func (m *Manager) tomorrow(now time.Time) time.Time {
|
func (m *Manager) tomorrow(now time.Time) time.Time {
|
||||||
return time.Date(now.Year(), now.Month(), now.Day()+1, 0, 0, 0, 0, now.Location())
|
return time.Date(now.Year(), now.Month(), now.Day()+1, 0, 0, 0, 0, now.Location())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -384,13 +384,19 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Controls Group
|
Item {
|
||||||
Column {
|
id: seekbarContainer
|
||||||
id: controlsGroup
|
|
||||||
width: parent.width
|
width: parent.width
|
||||||
spacing: Theme.spacingXS
|
anchors.top: songInfo.bottom
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: playbackControls.top
|
||||||
anchors.bottomMargin: 0
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
|
Column {
|
||||||
|
width: parent.width
|
||||||
|
spacing: 2
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
anchors.verticalCenterOffset: parent.height * 0.2
|
||||||
|
|
||||||
DankSeekbar {
|
DankSeekbar {
|
||||||
width: parent.width * 0.8
|
width: parent.width * 0.8
|
||||||
@@ -403,7 +409,7 @@ Item {
|
|||||||
|
|
||||||
Item {
|
Item {
|
||||||
width: parent.width * 0.8
|
width: parent.width * 0.8
|
||||||
height: 20
|
height: 16
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
@@ -429,7 +435,7 @@ Item {
|
|||||||
text: {
|
text: {
|
||||||
if (!activePlayer || !activePlayer.length)
|
if (!activePlayer || !activePlayer.length)
|
||||||
return "0:00";
|
return "0:00";
|
||||||
const dur = Math.max(0, activePlayer.length || 0); // Length is already in seconds
|
const dur = Math.max(0, activePlayer.length || 0);
|
||||||
const minutes = Math.floor(dur / 60);
|
const minutes = Math.floor(dur / 60);
|
||||||
const seconds = Math.floor(dur % 60);
|
const seconds = Math.floor(dur % 60);
|
||||||
return minutes + ":" + (seconds < 10 ? "0" : "") + seconds;
|
return minutes + ":" + (seconds < 10 ? "0" : "") + seconds;
|
||||||
@@ -438,10 +444,14 @@ Item {
|
|||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
id: playbackControls
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: 50
|
height: 50
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
@@ -809,5 +819,4 @@ Item {
|
|||||||
onExited: sharedTooltip.hide()
|
onExited: sharedTooltip.hide()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user