Ejemplo n.º 1
0
void layout_corners_frame(GtkWidget * vbox)
{
    GtkWidget * hbox;
    GtkWidget * junk;

    junk = gtk_check_button_new_with_label(_("Round Top Left Corner"));
    gtk_box_pack_startC(vbox, junk, FALSE, FALSE, 0);
    register_setting(junk, ST_BOOL, SECT, "round_top_left");

    junk = gtk_check_button_new_with_label(_("Round Top Right Corner"));
    gtk_box_pack_startC(vbox, junk, FALSE, FALSE, 0);
    register_setting(junk, ST_BOOL, SECT, "round_top_right");

    junk = gtk_check_button_new_with_label(_("Round Bottom Left Corner"));
    gtk_box_pack_startC(vbox, junk, FALSE, FALSE, 0);
    register_setting(junk, ST_BOOL, SECT, "round_bottom_left");

    junk = gtk_check_button_new_with_label(_("Round Bottom Right Corner"));
    gtk_box_pack_startC(vbox, junk, FALSE, FALSE, 0);
    register_setting(junk, ST_BOOL, SECT, "round_bottom_right");

#if GTK_CHECK_VERSION(3, 0, 0)
    hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
#else
    hbox = gtk_hbox_new(FALSE, 2);
#endif
    gtk_box_pack_startC(vbox, hbox, FALSE, FALSE, 0);

    gtk_box_pack_startC(hbox, gtk_label_new(_("Rounding Radius")), FALSE, FALSE, 0);

    junk = scaler_new(0, 20, 0.5);
    gtk_box_pack_startC(hbox, junk, TRUE, TRUE, 0);
    register_setting(junk, ST_FLOAT, SECT, "radius");
}
Ejemplo n.º 2
0
SettingItem * register_img_file_setting(GtkWidget * widget, gchar * section, gchar * key, GtkImage * image)
{
    SettingItem * item = register_setting(widget,ST_IMG_FILE,section,key);
    gtk_file_chooser_button_set_width_chars(GTK_FILE_CHOOSER_BUTTON(widget),0);
    item->image = image;
    item->preview = GTK_IMAGE(gtk_image_new());
    gtk_file_chooser_set_preview_widget(GTK_FILE_CHOOSER(widget),GTK_WIDGET(item->preview));
    g_signal_connect(widget,"update-preview",G_CALLBACK(update_preview_cb),
            item->preview);
    return item;
}
Ejemplo n.º 3
0
void add_color_alpha_value(gchar * caption, gchar * basekey, gchar * sect, gboolean active) 
{
    GtkWidget * w;
    gchar * colorkey;
    gchar * alphakey;
    colorkey = g_strdup_printf(active?"active_%s":"inactive_%s",basekey);
    alphakey = g_strdup_printf(active?"active_%s_alpha":"inactive_%s_alpha",
            basekey);
    
    w = gtk_label_new(caption);
    table_append(w,FALSE);

    w = gtk_color_button_new();
    table_append(w,FALSE);
    register_setting(w,ST_COLOR,sect,colorkey);

    w = scaler_new(0.0,1.0,0.01);
    table_append(w,TRUE);
    register_setting(w,ST_FLOAT,sect,alphakey);
    //we don't g_free because they are registered with register_setting
}
Ejemplo n.º 4
0
void init_engine_list()
{
    //presumes the container & combo are created
    //presumes the combo is NOT registered
    GtkCellRenderer * r;
    
    EngineModel = gtk_list_store_new(ENGINE_COL_COUNT,G_TYPE_STRING,
            G_TYPE_STRING,G_TYPE_STRING,G_TYPE_STRING,G_TYPE_STRING,GDK_TYPE_PIXBUF);
    gchar * local_engine_dir = g_strjoin("/",g_get_home_dir(),".emerald/engines",NULL);
    gtk_combo_box_set_model(GTK_COMBO_BOX(EngineCombo),GTK_TREE_MODEL(EngineModel));
    r = gtk_cell_renderer_pixbuf_new();
    gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(EngineCombo),r,FALSE);
    gtk_cell_layout_add_attribute(GTK_CELL_LAYOUT(EngineCombo),r,"pixbuf",ENGINE_COL_ICON);
    r = gtk_cell_renderer_text_new();
    gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(EngineCombo),r,TRUE);
    gtk_cell_layout_add_attribute(GTK_CELL_LAYOUT(EngineCombo),r,"markup",ENGINE_COL_MARKUP);
    engine_scan_dir(local_engine_dir);
    g_free(local_engine_dir);
    engine_scan_dir(ENGINE_DIR);
    
    register_setting(EngineCombo,ST_ENGINE_COMBO,"engine","engine");
}