mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 21:42:51 -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):
|
||||
return now.Add(sched.nightStepTime)
|
||||
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 {
|
||||
return time.Date(now.Year(), now.Month(), now.Day()+1, 0, 0, 0, 0, now.Location())
|
||||
}
|
||||
|
||||
@@ -384,13 +384,19 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
// Controls Group
|
||||
Column {
|
||||
id: controlsGroup
|
||||
Item {
|
||||
id: seekbarContainer
|
||||
width: parent.width
|
||||
spacing: Theme.spacingXS
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 0
|
||||
anchors.top: songInfo.bottom
|
||||
anchors.bottom: playbackControls.top
|
||||
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 {
|
||||
width: parent.width * 0.8
|
||||
@@ -403,7 +409,7 @@ Item {
|
||||
|
||||
Item {
|
||||
width: parent.width * 0.8
|
||||
height: 20
|
||||
height: 16
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
StyledText {
|
||||
@@ -429,7 +435,7 @@ Item {
|
||||
text: {
|
||||
if (!activePlayer || !activePlayer.length)
|
||||
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 seconds = Math.floor(dur % 60);
|
||||
return minutes + ":" + (seconds < 10 ? "0" : "") + seconds;
|
||||
@@ -438,10 +444,14 @@ Item {
|
||||
color: Theme.surfaceVariantText
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
id: playbackControls
|
||||
width: parent.width
|
||||
height: 50
|
||||
anchors.bottom: parent.bottom
|
||||
|
||||
Row {
|
||||
anchors.centerIn: parent
|
||||
@@ -809,5 +819,4 @@ Item {
|
||||
onExited: sharedTooltip.hide()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user