Start implementing new listbox style

parent 52cf1e8a
......@@ -119,7 +119,7 @@
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/libhandy",
"branch": "master"
"branch": "wip/exalm/isolated"
}
]
},
......
......@@ -3,12 +3,8 @@
}
.torrent-box {
border-radius: 5px;
border: 1px solid @borders;
color: @theme_fg_color;
box-shadow: 0 1px 2px rgba(0,0,0,0.07);
margin-top: 4px;
margin-bottom: 4px;
background-color: @theme_base_color;
}
......
......@@ -17,6 +17,8 @@ public class Fragments.TorrentGroup : Gtk.Box{
torrent_listbox.bind_model(torrents, (torrent) => {
TorrentRow row = new TorrentRow((Torrent)torrent);
if(rearrangeable){
// Add a bit margin to separate it from the non draggable listboxes
torrent_listbox.margin_bottom = 6;
drag_source_set (row.eventbox, Gdk.ModifierType.BUTTON1_MASK, TorrentListBox.entries, Gdk.DragAction.MOVE);
row.eventbox.drag_begin.connect (torrent_listbox.row_drag_begin);
row.eventbox.drag_data_get.connect (torrent_listbox.row_drag_data_get);
......@@ -48,4 +50,4 @@ public class Fragments.TorrentGroup : Gtk.Box{
this.set_visible(!empty);
}
}
\ No newline at end of file
}
......@@ -18,7 +18,7 @@ class Fragments.TorrentListBox : ListBox {
if(rearrangeable) drag_dest_set (this, Gtk.DestDefaults.ALL, entries, Gdk.DragAction.MOVE);
this.set_selection_mode(SelectionMode.NONE);
this.get_style_context ().add_class ("transparent");
this.get_style_context ().add_class ("preferences");
}
public void row_drag_begin (Widget widget, Gdk.DragContext context) {
......@@ -117,4 +117,4 @@ class Fragments.TorrentListBox : ListBox {
((TorrentRow)torrent).index_label.set_text((((TorrentRow)torrent).get_index()+1).to_string());
});
}
}
\ No newline at end of file
}
......@@ -27,7 +27,6 @@ public class Fragments.Window : Gtk.ApplicationWindow {
TorrentGroup seeding_group = new TorrentGroup(C_("Title of a list of torrents in the main window","Seeding"));
TorrentGroup queued_group = new TorrentGroup(C_("Title of a list of torrents in the main window","Queued"));
torrent_group_box = new Column();
Box groups = new Box(Orientation.VERTICAL, 0);
groups.spacing = 22;
groups.margin_bottom = 22;
......@@ -35,6 +34,8 @@ public class Fragments.Window : Gtk.ApplicationWindow {
groups.add(downloading_group);
groups.add(queued_group);
groups.add(seeding_group);
torrent_group_box = new Column();
torrent_group_box.add(groups);
torrent_group_box.show_all();
torrent_group_box.set_maximum_width(600);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment