Minor improvements

This commit is contained in:
Markus Koch 2017-02-19 14:52:53 +01:00
parent a6299aa7ac
commit 552b1568e3
3 changed files with 18 additions and 3 deletions

View File

@ -494,6 +494,7 @@
</object>
<object class="GtkWindow" id="settingsDialog">
<property name="can_focus">False</property>
<property name="window_position">center</property>
<property name="destroy_with_parent">True</property>
<child>
<object class="GtkBox">
@ -543,7 +544,17 @@
</object>
</child>
<child type="titlebar">
<placeholder/>
<object class="GtkHeaderBar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="title">Preferences</property>
<property name="has_subtitle">False</property>
<property name="show_close_button">True</property>
<property name="decoration_layout">close:</property>
<child>
<placeholder/>
</child>
</object>
</child>
</object>
</interface>

View File

@ -432,10 +432,12 @@ static void mainWindow_init_to_default(struct mainWindow *mainWindow)
*/
void mainWindow_renderer_set(struct mainWindow *mainWindow, enum renderer_mode state)
{
if (mainWindow->renderer == state)
return;
if (state == RENDERER_HTML) {
if (!mainWindow->webkitView) {
mainWindow->webkitView = webkit_web_view_new();
webkit_web_view_load_html_string(WEBKIT_WEB_VIEW(mainWindow->webkitView), "", "");
gtk_widget_show(mainWindow->webkitView);
mainWindow->webkitScrollArea = gtk_scrolled_window_new(NULL, NULL);
@ -464,7 +466,6 @@ static void mainWindow_settings_combo_changed(GtkComboBox *widget, gpointer user
else if (!strcmp(gtk_combo_box_get_active_id(GTK_COMBO_BOX(mainWindow->settingsDialog.comboDisplayMode)), "html"))
mainWindow_renderer_set(mainWindow, RENDERER_HTML);
mainWindow_entrySelected(NULL, user_data);
}
@ -564,6 +565,8 @@ struct mainWindow *mainWindow_new()
mainWindow->time_earliest = 0;
mainWindow->time_latest = 0;
mainWindow->renderer = RENDERER_NONE;
gtk_builder_connect_signals(builder, NULL);
g_object_unref(G_OBJECT(builder));

View File

@ -16,6 +16,7 @@ enum {
};
enum renderer_mode {
RENDERER_NONE = -1,
RENDERER_TEXT = 0,
RENDERER_BASIC,
RENDERER_HTML