diff options
-rw-r--r-- | src/sc_editor.c | 17 | ||||
-rw-r--r-- | src/sc_editor.h | 3 | ||||
-rw-r--r-- | src/slide_window.c | 3 |
3 files changed, 20 insertions, 3 deletions
diff --git a/src/sc_editor.c b/src/sc_editor.c index 8573259..773e7e4 100644 --- a/src/sc_editor.c +++ b/src/sc_editor.c @@ -1411,11 +1411,13 @@ void sc_editor_set_logical_size(SCEditor *e, double w, double h) { e->log_w = w; e->log_h = h; + e->top.w = w; + e->top.h = h; } /* FIXME: GObjectify this */ -SCEditor *sc_editor_new(SCBlock *scblocks) +SCEditor *sc_editor_new(SCBlock *scblocks, SCBlock *stylesheet) { SCEditor *sceditor; GtkTargetEntry targets[1]; @@ -1431,6 +1433,7 @@ SCEditor *sc_editor_new(SCBlock *scblocks) sceditor->log_w = 100; sceditor->log_h = 100; sceditor->is = imagestore_new(); + sceditor->stylesheet = stylesheet; sceditor->top.children = NULL; sceditor->top.num_children = 0; @@ -1438,6 +1441,18 @@ SCEditor *sc_editor_new(SCBlock *scblocks) sceditor->top.lines = NULL; sceditor->top.n_lines = 0; sceditor->top.max_lines = 0; + sceditor->top.pad_l = 0; + sceditor->top.pad_r = 0; + sceditor->top.pad_t = 0; + sceditor->top.pad_b = 0; + sceditor->top.w = sceditor->log_w; + sceditor->top.h = sceditor->log_h; + sceditor->top.grad = GRAD_NONE; + sceditor->top.bgcol[0] = 1.0; + sceditor->top.bgcol[1] = 1.0; + sceditor->top.bgcol[2] = 1.0; + sceditor->top.bgcol[3] = 1.0; + rerender(sceditor); diff --git a/src/sc_editor.h b/src/sc_editor.h index 694ad5b..5a59348 100644 --- a/src/sc_editor.h +++ b/src/sc_editor.h @@ -35,7 +35,8 @@ typedef struct _sceditor SCEditor; extern void sc_editor_set_slide(SCEditor *e, struct slide *s); extern GtkWidget *sc_editor_get_widget(SCEditor *e); -extern SCEditor *sc_editor_new(SCBlock *scblocks); +extern SCEditor *sc_editor_new(SCBlock *scblocks, SCBlock *stylesheet); extern void sc_editor_set_size(SCEditor *e, int w, int h); +extern void sc_editor_set_logical_size(SCEditor *e, double w, double h); #endif /* SC_EDITOR_H */ diff --git a/src/slide_window.c b/src/slide_window.c index 380ed2e..febbe43 100644 --- a/src/slide_window.c +++ b/src/slide_window.c @@ -601,7 +601,7 @@ SlideWindow *slide_window_open(struct presentation *p, GApplication *app) vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); gtk_container_add(GTK_CONTAINER(window), vbox); - sw->sceditor = sc_editor_new(sw->cur_slide->scblocks); + sw->sceditor = sc_editor_new(sw->cur_slide->scblocks, p->stylesheet); scroll = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll), GTK_POLICY_AUTOMATIC, @@ -612,6 +612,7 @@ SlideWindow *slide_window_open(struct presentation *p, GApplication *app) /* Size of SCEditor surface in pixels */ /* FIXME: Somewhat arbitrary. Should come from slide itself */ sc_editor_set_size(sw->sceditor, 1024, 768); + sc_editor_set_logical_size(sw->sceditor, 1024.0, 768.0); add_menu_bar(sw, vbox); gtk_box_pack_start(GTK_BOX(vbox), scroll, TRUE, TRUE, 0); |