summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <waker@users.sourceforge.net>2013-11-14 20:58:07 +0100
committerGravatar Alexey Yakovenko <waker@users.sourceforge.net>2013-11-14 20:58:07 +0100
commitd8d888f26a89c6dfa376ebbf0c7af83df16a6d5b (patch)
treed99a4795437bca64a6764de06fff36d2c9297c4b /plugins
parent27656b4326a28e4207a89c31b21834f013cf6b6a (diff)
gtkui: fixed the issue when resizing the window while it has playlist with autoresize columns and containing album art column
Diffstat (limited to 'plugins')
-rw-r--r--plugins/gtkui/ddblistview.c26
-rw-r--r--plugins/gtkui/mainplaylist.c5
2 files changed, 23 insertions, 8 deletions
diff --git a/plugins/gtkui/ddblistview.c b/plugins/gtkui/ddblistview.c
index 100561c8..5fe1d4e8 100644
--- a/plugins/gtkui/ddblistview.c
+++ b/plugins/gtkui/ddblistview.c
@@ -76,7 +76,7 @@ static void ddb_listview_init(DdbListview *listview);
//static void ddb_listview_paint(GtkWidget *widget);
static void ddb_listview_destroy(GObject *object);
-static void
+void
ddb_listview_build_groups (DdbListview *listview);
// fwd decls
@@ -2389,23 +2389,31 @@ ddb_listview_header_configure_event (GtkWidget *widget,
if (height != a.height) {
gtk_widget_set_size_request (widget, -1, height);
}
+ int totalwidth = a.width;
+ if (GTK_WIDGET_VISIBLE (ps->scrollbar)) {
+ GtkAllocation sba;
+ gtk_widget_get_allocation (ps->scrollbar, &sba);
+ totalwidth += sba.width;
+ }
if (!ps->lock_columns) {
DdbListviewColumn *c;
- if (ps->header_width != a.width && deadbeef->conf_get_int ("gtkui.autoresize_columns", 0)) {
+ if (ps->header_width != totalwidth && deadbeef->conf_get_int ("gtkui.autoresize_columns", 0)) {
if (!ps->col_autoresize) {
for (c = ps->columns; c; c = c->next) {
- c->fwidth = (float)c->width / (float)a.width;
+ c->fwidth = (float)c->width / (float)totalwidth;
}
ps->col_autoresize = 1;
}
// use the fwidth
int changed = 0;
- for (c = ps->columns; c; c = c->next) {
- int newwidth = a.width * c->fwidth;
+ int i = 0;
+ for (c = ps->columns; c; c = c->next, i++) {
+ int newwidth = totalwidth * c->fwidth;
if (newwidth != c->width) {
c->width = newwidth;
changed = 1;
+ ps->binding->column_size_changed (ps, i);
}
}
if (changed) {
@@ -2415,11 +2423,13 @@ ddb_listview_header_configure_event (GtkWidget *widget,
else {
if (ps->col_autoresize) {
int changed = 0;
- for (c = ps->columns; c; c = c->next) {
- int newwidth = a.width * c->fwidth;
+ int i = 0;
+ for (c = ps->columns; c; c = c->next, i++) {
+ int newwidth = totalwidth * c->fwidth;
if (newwidth != c->width) {
c->width = newwidth;
changed = 1;
+ ps->binding->column_size_changed (ps, i);
}
}
ps->col_autoresize = 0;
@@ -2429,7 +2439,7 @@ ddb_listview_header_configure_event (GtkWidget *widget,
}
}
}
- ps->header_width = a.width;
+ ps->header_width = totalwidth;
return FALSE;
}
diff --git a/plugins/gtkui/mainplaylist.c b/plugins/gtkui/mainplaylist.c
index 99eebd63..d1920021 100644
--- a/plugins/gtkui/mainplaylist.c
+++ b/plugins/gtkui/mainplaylist.c
@@ -254,6 +254,11 @@ main_column_size_changed (DdbListview *listview, int col) {
}
if (inf->id == DB_COLUMN_ALBUM_ART) {
coverart_reset_queue ();
+ ddb_playlist_t *plt = deadbeef->plt_get_curr ();
+ if (plt) {
+ deadbeef->plt_modified (plt);
+ deadbeef->plt_unref (plt);
+ }
}
}