moved progressbar into draw command

This commit is contained in:
Robinson 2023-11-25 22:08:09 +01:00
parent 543ba0ec62
commit 71bc6e7f8b
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C
2 changed files with 14 additions and 14 deletions

View File

@ -206,13 +206,6 @@ internal class AppNotify(override val notification: Notify): Canvas(), NotifyTyp
} catch (ignored2: Exception) {
}
}
// the progress bar can change, so we always draw it every time
if (progress > 0 && prevProgress != progress) {
// draw the progress bar along the bottom
g.color = notification.theme.progress_FG
g.fillRect(0, Notify.HEIGHT - 2, progress, 2)
}
}
private fun draw(g: Graphics) {
@ -225,6 +218,13 @@ internal class AppNotify(override val notification: Notify): Canvas(), NotifyTyp
g.drawImage(cachedClose, 0, 0, null)
}
}
// the progress bar can change, so we always draw it every time
if (progress > 0 && prevProgress != progress) {
// draw the progress bar along the bottom
g.color = notification.theme.progress_FG
g.fillRect(0, Notify.HEIGHT - 2, progress, 2)
}
}
fun onClick(x: Int, y: Int) {

View File

@ -182,13 +182,6 @@ internal class DesktopNotify(override val notification: Notify) : JWindow(), Not
} catch (ignored2: Exception) {
}
}
// the progress bar can change (only getting bigger!), so we always draw it when it grows
if (progress > 0 && prevProgress != progress) {
// draw the progress bar along the bottom
g.color = notification.theme.progress_FG
g.fillRect(0, Notify.HEIGHT - 2, progress, 2)
}
}
private fun draw(g: Graphics) {
@ -201,6 +194,13 @@ internal class DesktopNotify(override val notification: Notify) : JWindow(), Not
g.drawImage(cachedClose, 0, 0, null)
}
}
// the progress bar can change (only getting bigger!), so we always draw it when it grows
if (progress > 0 && prevProgress != progress) {
// draw the progress bar along the bottom
g.color = notification.theme.progress_FG
g.fillRect(0, Notify.HEIGHT - 2, progress, 2)
}
}
fun onClick() {