コード例 #1
0
ファイル: legacy.c プロジェクト: compiz-reloaded/emerald
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");
}
コード例 #2
0
ファイル: themer.c プロジェクト: Jubei-Mitsuyoshi/aaa-emerald
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
}