summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 21f8df3)
raw | patch | inline | side by side (parent: 21f8df3)
author | Max Kellermann <max@duempel.org> | |
Sat, 3 Oct 2009 20:04:54 +0000 (22:04 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Sat, 3 Oct 2009 20:04:54 +0000 (22:04 +0200) |
src/status_bar.c | patch | blob | history | |
src/status_bar.h | patch | blob | history |
diff --git a/src/status_bar.c b/src/status_bar.c
index 204a66ecb28166a7b6a7fadd211e11393fc1e123..19eec1d0c584b1eb52bacda87fc05990bfd9b443 100644 (file)
--- a/src/status_bar.c
+++ b/src/status_bar.c
#include "player_command.h"
#include "utils.h"
-#ifndef NCMPC_MINI
-#include "hscroll.h"
-#endif
-
#include <mpd/client.h>
#include <assert.h>
}
void
-status_bar_paint(const struct status_bar *p, const struct mpd_status *status,
+status_bar_paint(struct status_bar *p, const struct mpd_status *status,
const struct mpd_song *song)
{
WINDOW *w = p->window.w;
/* scroll if the song name is to long */
#ifndef NCMPC_MINI
if (options.scroll && utf8_width(songname) > (unsigned)width) {
- static struct hscroll hscroll = { 0, 0 };
- char *tmp = strscroll(&hscroll, songname,
+ char *tmp = strscroll(&p->hscroll, songname,
options.scroll_sep, width);
g_strlcpy(songname, tmp, sizeof(songname));
diff --git a/src/status_bar.h b/src/status_bar.h
index 902ed1a22829824a9f20ba79e0a38af4ca851ac1..c97c7a1a6398a72b87d3bf9ef253f93d059f2699 100644 (file)
--- a/src/status_bar.h
+++ b/src/status_bar.h
#include "window.h"
+#ifndef NCMPC_MINI
+#include "hscroll.h"
+#endif
+
#include <glib.h>
#include <stdbool.h>
struct window window;
guint message_source_id;
+
+#ifndef NCMPC_MINI
+ struct hscroll hscroll;
+#endif
};
static inline void
keypad(p->window.w, true);
p->message_source_id = 0;
+
+#ifndef NCMPC_MINI
+ hscroll_reset(&p->hscroll);
+ p->hscroll.t = 0;
+#endif
}
static inline void
}
void
-status_bar_paint(const struct status_bar *p, const struct mpd_status *status,
+status_bar_paint(struct status_bar *p, const struct mpd_status *status,
const struct mpd_song *song);
void