Skip to content

Commit 0ea8c16

Browse files
committed
Item visibility & fix pdf export of a deleted canvas
1 parent f4b4acc commit 0ea8c16

4 files changed

Lines changed: 13 additions & 5 deletions

File tree

src/Services/FileManager.vala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ public class Spice.Services.FileManager {
5252
}
5353

5454
public static File? open_image () {
55-
56-
5755
List<Gtk.FileFilter> filters = new List<Gtk.FileFilter> ();
5856
Gtk.FileFilter filter = new Gtk.FileFilter ();
5957
filter.set_filter_name ("Images");
@@ -180,6 +178,8 @@ public class Spice.Services.FileManager {
180178
Timeout.add (600 * pages_to_draw, () => {
181179
bool first = true;
182180
foreach (var slide in manager.slides) {
181+
if (!slide.visible) continue;
182+
183183
if (!first) {
184184
pdf.copy_page ();
185185
} else {

src/Widgets/CanvasItems/CanvasItem.vala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ public abstract class Spice.CanvasItem : Gtk.EventBox {
4646
}
4747
}
4848

49+
public bool item_visible {
50+
get {
51+
return this.visible;
52+
} set {
53+
this.visible = value;
54+
this.no_show_all = !value;
55+
}
56+
}
57+
4958
protected double start_x = 0;
5059
protected double start_y = 0;
5160
protected int start_w = 0;

src/Widgets/SlideList.vala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ public class Spice.SlideList : Gtk.ScrolledWindow {
129129
this.visible = val;
130130
this.no_show_all = !val;
131131

132-
stderr.printf (@"Row.Visible changed $val\n");
133132

134133
this.show_all ();
135134
});

src/Widgets/Toolbars/CommonBar.vala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ public class Spice.Widgets.CommonToolbar : Spice.Widgets.Toolbar {
3636

3737
delete_button.clicked.connect (() => {
3838
if (this.item != null) {
39-
var action = new Spice.Services.HistoryManager.HistoryAction<CanvasItem,bool>.item_changed (this.item, "visible");
39+
var action = new Spice.Services.HistoryManager.HistoryAction<CanvasItem,bool>.item_changed (this.item, "item-visible");
4040
Spice.Services.HistoryManager.get_instance ().add_undoable_action (action, true);
4141

42-
this.item.visible = false;
42+
this.item.item_visible = false;
4343
} else {
4444
var action = new Spice.Services.HistoryManager.HistoryAction<Slide,bool>.slide_changed (this.manager.current_slide, "visible");
4545
Spice.Services.HistoryManager.get_instance ().add_undoable_action (action, true);

0 commit comments

Comments
 (0)