summaryrefslogtreecommitdiff
path: root/src/Page.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2018-07-09 12:10:38 +0200
committerJörg Frings-Fürst <debian@jff.email>2018-07-09 12:10:38 +0200
commit709e2d6f5652ec90c194a4ec2b530bebc6f952cb (patch)
tree496b2f3899e1d5728ee9ae76095cc5056c317447 /src/Page.vala
parentf1353e9ffd34db5f755c7da0b3f9c10638fbfd38 (diff)
parent5c8be07095cc04a6d8a95204b0504fd7ab030154 (diff)
Merge branch 'release/0.28.3-1'0.28.3-1
Diffstat (limited to 'src/Page.vala')
-rw-r--r--src/Page.vala38
1 files changed, 16 insertions, 22 deletions
diff --git a/src/Page.vala b/src/Page.vala
index 88fecc7..ea8606e 100644
--- a/src/Page.vala
+++ b/src/Page.vala
@@ -328,18 +328,6 @@ public abstract class Page : Gtk.ScrolledWindow {
action.set_enabled (sensitive);
}
- public void set_action_important(string name, bool important) {
- set_action_sensitive (name, important);
- }
-
- public void set_action_visible(string name, bool visible) {
- set_action_sensitive (name, visible);
- }
-
- public void set_action_short_label(string name, string short_label) {
- debug ("=> Set action short_label called for %s", name);
- }
-
public void set_action_details(string name, string? label, string? tooltip, bool sensitive) {
GLib.SimpleAction? action = get_action(name) as GLib.SimpleAction;
@@ -2031,6 +2019,11 @@ public abstract class SinglePhotoPage : Page {
canvas.draw.connect(on_canvas_exposed);
set_event_source(canvas);
+ Config.Facade.get_instance().colors_changed.connect(on_colors_changed);
+ }
+
+ ~SinglePhotoPage() {
+ Config.Facade.get_instance().colors_changed.disconnect(on_colors_changed);
}
public bool is_transition_in_progress() {
@@ -2081,9 +2074,7 @@ public abstract class SinglePhotoPage : Page {
int draw_y = (pixmap_dim.height - view_rect.height) / 2;
draw_y = draw_y.clamp(0, int.MAX);
-
- Gdk.cairo_set_source_pixbuf(pixmap_ctx, zoomed, draw_x, draw_y);
- pixmap_ctx.paint();
+ paint_pixmap_with_background(pixmap_ctx, zoomed, draw_x, draw_y);
}
protected void on_interactive_zoom(ZoomState interactive_zoom_state) {
@@ -2270,7 +2261,7 @@ public abstract class SinglePhotoPage : Page {
// when the resize is completed, do a high-quality repaint
repaint();
}
-
+
private bool on_canvas_exposed(Cairo.Context exposed_ctx) {
// draw pixmap onto canvas unless it's not been instantiated, in which case draw black
// (so either old image or contents of another page is not left on screen)
@@ -2290,7 +2281,7 @@ public abstract class SinglePhotoPage : Page {
protected virtual void updated_pixbuf(Gdk.Pixbuf pixbuf, UpdateReason reason, Dimensions old_dim) {
}
-
+
protected virtual void paint(Cairo.Context ctx, Dimensions ctx_dim) {
if (is_zoom_supported() && (!static_zoom_state.is_default())) {
set_source_color_from_string(ctx, "#000");
@@ -2301,12 +2292,11 @@ public abstract class SinglePhotoPage : Page {
} else if (!transition_clock.paint(ctx, ctx_dim.width, ctx_dim.height)) {
// transition is not running, so paint the full image on a black background
set_source_color_from_string(ctx, "#000");
-
+
ctx.rectangle(0, 0, pixmap_dim.width, pixmap_dim.height);
ctx.fill();
-
- Gdk.cairo_set_source_pixbuf(ctx, scaled, scaled_pos.x, scaled_pos.y);
- ctx.paint();
+
+ paint_pixmap_with_background(ctx, scaled, scaled_pos.x, scaled_pos.y);
}
}
@@ -2485,6 +2475,11 @@ public abstract class SinglePhotoPage : Page {
return (base.key_press_event != null) ? base.key_press_event(event) : true;
}
+
+ private void on_colors_changed() {
+ invalidate_transparent_background();
+ repaint();
+ }
}
//
@@ -2667,5 +2662,4 @@ public class DragAndDropHandler {
exporter = null;
}
-
}