static GtkWidget * add_row (CcPrivacyPanel *self, const gchar *label, const gchar *dialog_id, GtkWidget *status) { GtkWidget *box, *row, *w; row = gtk_list_box_row_new (); box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 50); gtk_container_add (GTK_CONTAINER (row), box); g_object_set_data (G_OBJECT (row), "dialog-id", (gpointer)dialog_id); gtk_widget_set_hexpand (box, TRUE); gtk_container_add (GTK_CONTAINER (self->priv->list_box), row); w = gtk_label_new (label); gtk_widget_set_halign (w, GTK_ALIGN_START); gtk_widget_set_margin_start (w, 20); gtk_widget_set_margin_end (w, 20); gtk_widget_set_margin_top (w, 12); gtk_widget_set_margin_bottom (w, 12); gtk_widget_set_halign (w, GTK_ALIGN_START); gtk_widget_set_valign (w, GTK_ALIGN_CENTER); gtk_widget_set_hexpand (w, TRUE); gtk_box_pack_start (GTK_BOX (box), w, TRUE, TRUE, 0); gtk_widget_set_margin_start (status, 20); gtk_widget_set_margin_end (status, 20); gtk_widget_set_halign (status, GTK_ALIGN_END); gtk_widget_set_valign (status, GTK_ALIGN_CENTER); gtk_box_pack_end (GTK_BOX (box), status, FALSE, FALSE, 0); gtk_widget_show_all (row); return row; }
static GtkWidget * ppd_option_add (ppd_option_t option, const gchar *printer_name, GtkWidget *grid, gboolean sensitive) { GtkStyleContext *context; GtkWidget *widget; GtkWidget *label; gint position; widget = (GtkWidget *) pp_ppd_option_widget_new (&option, printer_name); if (widget) { gtk_widget_set_sensitive (widget, sensitive); position = grid_get_height (grid); label = gtk_label_new (ppd_option_name_translate (&option)); context = gtk_widget_get_style_context (label); gtk_style_context_add_class (context, "dim-label"); gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); gtk_widget_set_margin_start (label, 10); gtk_grid_attach (GTK_GRID (grid), label, 0, position, 1, 1); gtk_widget_set_margin_start (widget, 20); gtk_grid_attach (GTK_GRID (grid), widget, 1, position, 1, 1); } return widget; }
static void add_dns_row (CEPageIP6 *page, const gchar *address) { GtkWidget *row; GtkWidget *row_box; GtkWidget *label; GtkWidget *widget; GtkWidget *delete_button; GtkWidget *image; row = gtk_list_box_row_new (); gtk_widget_set_can_focus (row, FALSE); row_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); label = gtk_label_new (_("Server")); gtk_widget_set_halign (label, GTK_ALIGN_END); gtk_box_pack_start (GTK_BOX (row_box), label, FALSE, FALSE, 0); widget = gtk_entry_new (); gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget); g_signal_connect_swapped (widget, "changed", G_CALLBACK (ce_page_changed), page); g_object_set_data (G_OBJECT (row), "address", widget); gtk_entry_set_text (GTK_ENTRY (widget), address); gtk_widget_set_margin_start (widget, 10); gtk_widget_set_margin_end (widget, 10); gtk_widget_set_hexpand (widget, TRUE); gtk_box_pack_start (GTK_BOX (row_box), widget, TRUE, TRUE, 0); delete_button = gtk_button_new (); gtk_style_context_add_class (gtk_widget_get_style_context (delete_button), "image-button"); g_signal_connect (delete_button, "clicked", G_CALLBACK (remove_row), page); image = gtk_image_new_from_icon_name ("user-trash-symbolic", GTK_ICON_SIZE_MENU); atk_object_set_name (gtk_widget_get_accessible (delete_button), _("Delete DNS Server")); gtk_button_set_image (GTK_BUTTON (delete_button), image); gtk_box_pack_start (GTK_BOX (row_box), delete_button, FALSE, FALSE, 0); g_object_set_data (G_OBJECT (row), "delete-button", delete_button); gtk_widget_set_margin_start (row_box, 10); gtk_widget_set_margin_end (row_box, 10); gtk_widget_set_margin_top (row_box, 10); gtk_widget_set_margin_bottom (row_box, 10); gtk_widget_set_halign (row_box, GTK_ALIGN_FILL); gtk_container_add (GTK_CONTAINER (row), row_box); gtk_widget_show_all (row); gtk_container_add (GTK_CONTAINER (page->dns_list), row); update_row_sensitivity (page, page->dns_list); }
static void ensure_size_window (MetaResizePopup *popup) { GtkWidget *frame; if (popup->size_window) return; popup->size_window = gtk_window_new (GTK_WINDOW_POPUP); gtk_window_set_screen (GTK_WINDOW (popup->size_window), gdk_display_get_default_screen (gdk_x11_lookup_xdisplay (popup->display))); /* never shrink the size window */ gtk_window_set_resizable (GTK_WINDOW (popup->size_window), TRUE); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT); gtk_container_add (GTK_CONTAINER (popup->size_window), frame); popup->size_label = gtk_label_new (""); gtk_widget_set_margin_start (popup->size_label, 3); gtk_widget_set_margin_end (popup->size_label, 3); gtk_widget_set_margin_top (popup->size_label, 3); gtk_widget_set_margin_bottom (popup->size_label, 3); gtk_container_add (GTK_CONTAINER (frame), popup->size_label); gtk_widget_show_all (frame); }
static GtkWidget * create_complex_popover (GtkWidget *parent, GtkPositionType pos) { GtkWidget *popover, *window, *content; GtkBuilder *builder; builder = gtk_builder_new (); gtk_builder_add_from_resource (builder, "/popover/popover.ui", NULL); window = GTK_WIDGET (gtk_builder_get_object (builder, "window")); content = gtk_bin_get_child (GTK_BIN (window)); g_object_ref (content); gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (content)), content); gtk_widget_destroy (window); g_object_unref (builder); popover = create_popover (parent, content, GTK_POS_BOTTOM); g_object_unref (content); gtk_widget_set_size_request (popover, 200, -1); gtk_widget_set_vexpand (popover, TRUE); gtk_widget_set_margin_start (popover, 10); gtk_widget_set_margin_end (popover, 10); gtk_widget_set_margin_bottom (popover, 10); return popover; }
/* Function taken from gtkprintunixdialog.c */ static GtkWidget * photos_print_setup_wrap_in_frame (const gchar *label, GtkWidget *child) { GtkWidget *frame; GtkWidget *label_widget; gchar *bold_text; label_widget = gtk_label_new (""); gtk_label_set_xalign (GTK_LABEL (label_widget), 0.0); gtk_widget_show (label_widget); bold_text = g_markup_printf_escaped ("<b>%s</b>", label); gtk_label_set_markup (GTK_LABEL (label_widget), bold_text); g_free (bold_text); frame = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); gtk_box_pack_start (GTK_BOX (frame), label_widget, FALSE, FALSE, 0); gtk_widget_set_margin_start (child, 12); gtk_widget_set_halign (child, GTK_ALIGN_FILL); gtk_widget_set_valign (child, GTK_ALIGN_FILL); gtk_box_pack_start (GTK_BOX (frame), child, FALSE, FALSE, 0); gtk_widget_show (frame); return frame; }
static void photos_edit_palette_row_constructed (GObject *object) { PhotosEditPaletteRow *self = PHOTOS_EDIT_PALETTE_ROW (object); GtkWidget *grid0; GtkWidget *grid1; GtkWidget *image; GtkWidget *label; GtkWidget *tool_widget; const gchar *icon_name; const gchar *name; gchar *name_markup; G_OBJECT_CLASS (photos_edit_palette_row_parent_class)->constructed (object); self->row_revealer = gtk_revealer_new(); gtk_revealer_set_transition_type (GTK_REVEALER (self->row_revealer), GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN); gtk_container_add (GTK_CONTAINER (self), self->row_revealer); grid0 = gtk_grid_new (); gtk_widget_set_margin_bottom (grid0, 6); gtk_widget_set_margin_start (grid0, 18); gtk_widget_set_margin_end (grid0, 18); gtk_widget_set_margin_top (grid0, 6); gtk_orientable_set_orientation (GTK_ORIENTABLE (grid0), GTK_ORIENTATION_VERTICAL); gtk_container_add (GTK_CONTAINER (self->row_revealer), grid0); grid1 = gtk_grid_new (); gtk_orientable_set_orientation (GTK_ORIENTABLE (grid1), GTK_ORIENTATION_HORIZONTAL); gtk_grid_set_column_spacing (GTK_GRID (grid1), 12); gtk_container_add (GTK_CONTAINER (grid0), grid1); icon_name = photos_tool_get_icon_name (self->tool); image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_BUTTON); gtk_container_add (GTK_CONTAINER (grid1), image); name = photos_tool_get_name (self->tool); label = gtk_label_new (NULL); name_markup = g_strdup_printf ("<b>%s</b>", name); gtk_label_set_markup (GTK_LABEL (label), name_markup); gtk_container_add (GTK_CONTAINER (grid1), label); self->details_revealer = gtk_revealer_new (); gtk_revealer_set_transition_type (GTK_REVEALER (self->details_revealer), GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN); gtk_container_add (GTK_CONTAINER (grid0), self->details_revealer); tool_widget = photos_tool_get_widget (self->tool); gtk_widget_set_margin_bottom (tool_widget, 12); gtk_widget_set_margin_top (tool_widget, 12); gtk_container_add (GTK_CONTAINER (self->details_revealer), tool_widget); gtk_size_group_add_widget (self->size_group, tool_widget); g_signal_connect_swapped (self->tool, "hide-requested", G_CALLBACK (photos_edit_palette_row_hide_details), self); gtk_widget_show_all (GTK_WIDGET (self)); g_free (name_markup); g_clear_object (&self->size_group); /* We will not need it any more */ }
static void nautilus_floating_bar_constructed (GObject *obj) { NautilusFloatingBar *self = NAUTILUS_FLOATING_BAR (obj); GtkWidget *w, *box; G_OBJECT_CLASS (nautilus_floating_bar_parent_class)->constructed (obj); box = GTK_WIDGET (obj); w = gtk_spinner_new (); gtk_box_pack_start (GTK_BOX (box), w, FALSE, FALSE, 0); gtk_widget_set_visible (w, self->priv->show_spinner); self->priv->spinner = w; gtk_widget_set_size_request (w, 16, 16); gtk_widget_set_margin_start (w, 8); w = gtk_label_new (NULL); gtk_label_set_ellipsize (GTK_LABEL (w), PANGO_ELLIPSIZE_MIDDLE); gtk_box_pack_start (GTK_BOX (box), w, FALSE, FALSE, 0); g_object_set (w, "margin-top", 2, "margin-bottom", 2, "margin-left", 12, "margin-right", 12, "max-width-chars", 60, NULL); self->priv->label_widget = w; gtk_widget_show (w); }
static GtkWidget * handle_builder_error (const gchar *message, ...) { GtkWidget *label; gchar *msg; gchar *msg_plain; va_list args; va_start (args, message); msg_plain = g_strdup_vprintf (message, args); va_end (args); label = gtk_label_new (NULL); gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); msg = g_strconcat ("<span size=\"large\" weight=\"bold\">", msg_plain, "</span>\n\n", _("Please check your installation."), NULL); gtk_label_set_markup (GTK_LABEL (label), msg); g_free (msg_plain); g_free (msg); gtk_widget_set_margin_start (label, 6); gtk_widget_set_margin_end (label, 6); gtk_widget_set_margin_top (label, 6); gtk_widget_set_margin_bottom (label, 6); return label; }
static void update_title_header (GtkListBoxRow *row, GtkListBoxRow *before, gpointer data) { GtkWidget *header; gchar *title; header = gtk_list_box_row_get_header (row); title = (gchar *)g_object_get_data (G_OBJECT (row), "title"); if (!header && title) { title = g_strdup_printf ("<b>%s</b>", title); header = gtk_label_new (title); gtk_label_set_use_markup (GTK_LABEL (header), TRUE); gtk_widget_set_halign (header, GTK_ALIGN_START); gtk_widget_set_margin_top (header, 12); gtk_widget_set_margin_start (header, 6); gtk_widget_set_margin_end (header, 6); gtk_widget_set_margin_bottom (header, 6); gtk_widget_show (header); gtk_list_box_row_set_header (row, header); g_free (title); } }
static gboolean ask_and_delete(gpointer user_data) { GList *empty_dirs = (GList *)user_data; const int n_empty_dirs = g_list_length(empty_dirs); GtkWidget *dialog; GtkWidget *win = dt_ui_main_window(darktable.gui->ui); dialog = gtk_message_dialog_new(GTK_WINDOW(win), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, ngettext("do you want to remove this empty directory?", "do you want to remove these empty directories?", n_empty_dirs)); gtk_window_set_title(GTK_WINDOW(dialog), ngettext("remove empty directory?", "remove empty directories?", n_empty_dirs)); GtkWidget *content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog)); GtkWidget *scroll = gtk_scrolled_window_new(NULL, NULL); gtk_widget_set_vexpand(scroll, TRUE); gtk_widget_set_margin_start(scroll, DT_PIXEL_APPLY_DPI(10)); gtk_widget_set_margin_end(scroll, DT_PIXEL_APPLY_DPI(10)); gtk_widget_set_margin_top(scroll, DT_PIXEL_APPLY_DPI(0)); gtk_widget_set_margin_bottom(scroll, DT_PIXEL_APPLY_DPI(0)); GtkListStore *store = gtk_list_store_new(1, G_TYPE_STRING); for(GList *list_iter = empty_dirs; list_iter; list_iter = g_list_next(list_iter)) { GtkTreeIter iter; gtk_list_store_append(store, &iter); gtk_list_store_set(store, &iter, 0, list_iter->data, -1); } GtkWidget *tree = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(tree), FALSE); GtkTreeViewColumn *column = gtk_tree_view_column_new_with_attributes(_("name"), gtk_cell_renderer_text_new(), "text", 0, NULL); gtk_tree_view_append_column(GTK_TREE_VIEW(tree), column); gtk_container_add(GTK_CONTAINER(scroll), tree); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); gtk_container_add(GTK_CONTAINER(content_area), scroll); gtk_widget_show_all(dialog); // needed for the content area! gint res = gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); if(res == GTK_RESPONSE_YES) for(GList *iter = empty_dirs; iter; iter = g_list_next(iter)) rmdir((char *)iter->data); g_list_free_full(empty_dirs, g_free); g_object_unref(store); return FALSE; }
static void gis_page_init (GisPage *page) { gtk_widget_set_margin_start (GTK_WIDGET (page), 12); gtk_widget_set_margin_top (GTK_WIDGET (page), 12); gtk_widget_set_margin_bottom (GTK_WIDGET (page), 12); gtk_widget_set_margin_end (GTK_WIDGET (page), 12); }
static void set_row_widget_margins (GtkWidget *widget) { gtk_widget_set_margin_start (widget, 20); gtk_widget_set_margin_end (widget, 20); gtk_widget_set_margin_top (widget, 6); gtk_widget_set_margin_bottom (widget, 6); }
void huayra_hig_workarea_table_add_wide_control(GtkWidget *table, guint *row, GtkWidget *widget) { gtk_grid_attach (GTK_GRID(table), widget, 0, *row, 2, 1); gtk_widget_set_margin_start (GTK_WIDGET(widget), 12); ++ * row; }
static void show_account (GoaProvider *provider, GoaClient *client, GoaObject *object, GtkBox *vbox, G_GNUC_UNUSED GtkGrid *dummy1, G_GNUC_UNUSED GtkGrid *dummy2) { EditData *data = NULL; GtkWidget *grid; GtkWidget *params_button = NULL; GtkWidget *details_button = NULL; GtkWidget *button_box = NULL; gint row = 0; goa_utils_account_add_attention_needed (client, object, provider, vbox); grid = gtk_grid_new (); gtk_widget_set_halign (grid, GTK_ALIGN_CENTER); gtk_widget_set_hexpand (grid, TRUE); gtk_widget_set_margin_end (grid, 72); gtk_widget_set_margin_start (grid, 72); gtk_widget_set_margin_top (grid, 24); gtk_grid_set_column_spacing (GTK_GRID (grid), 12); gtk_grid_set_row_spacing (GTK_GRID (grid), 6); gtk_container_add (GTK_CONTAINER (vbox), grid); goa_utils_account_add_header (object, GTK_GRID (grid), row++); goa_util_add_row_switch_from_keyfile_with_blurb (GTK_GRID (grid), row++, object, /* Translators: This is a label for a series of * options switches. For example: “Use for Mail”. */ _("Use for"), "chat-disabled", _("C_hat")); data = edit_data_new (object, tpaw_get_toplevel_window (GTK_WIDGET (vbox))); /* Connection Settings button */ params_button = gtk_button_new_with_mnemonic (_("_Connection Settings")); edit_data_handle_button (data, params_button, G_CALLBACK (edit_parameters_clicked_cb)); /* Edit Personal Information button */ details_button = gtk_button_new_with_mnemonic (_("_Personal Details")); edit_data_handle_button (data, details_button, G_CALLBACK (edit_personal_details_clicked_cb)); /* Box containing the buttons */ button_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_box_pack_start (GTK_BOX (button_box), params_button, FALSE, FALSE, 12); gtk_container_add (GTK_CONTAINER (button_box), details_button); goa_util_add_row_widget (GTK_GRID (grid), row++, NULL, button_box); edit_data_unref (data); }
static void gtk_tooltip_init (GtkTooltip *tooltip) { GtkStyleContext *context; GtkWidget *window; GtkWidget *box; GtkWidget *image; GtkWidget *label; tooltip->timeout_id = 0; tooltip->browse_mode_timeout_id = 0; tooltip->browse_mode_enabled = FALSE; tooltip->keyboard_mode_enabled = FALSE; tooltip->current_window = NULL; tooltip->keyboard_widget = NULL; tooltip->tooltip_widget = NULL; tooltip->last_window = NULL; window = gtk_window_new (GTK_WINDOW_POPUP); gtk_window_set_type_hint (GTK_WINDOW (window), GDK_WINDOW_TYPE_HINT_TOOLTIP); gtk_window_set_resizable (GTK_WINDOW (window), FALSE); gtk_window_set_use_subsurface (GTK_WINDOW (window), TRUE); g_signal_connect (window, "hide", G_CALLBACK (gtk_tooltip_window_hide), tooltip); _gtk_window_request_csd (GTK_WINDOW (window)); context = gtk_widget_get_style_context (window); gtk_style_context_add_class (context, GTK_STYLE_CLASS_TOOLTIP); /* FIXME: don't hardcode the padding */ box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); gtk_widget_set_margin_start (box, 6); gtk_widget_set_margin_end (box, 6); gtk_widget_set_margin_top (box, 6); gtk_widget_set_margin_bottom (box, 6); gtk_container_add (GTK_CONTAINER (window), box); gtk_widget_show (box); image = gtk_image_new (); gtk_box_pack_start (GTK_BOX (box), image, FALSE, FALSE, 0); label = gtk_label_new (""); gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0); tooltip->window = window; tooltip->box = box; tooltip->image = image; tooltip->label = label; tooltip->custom_widget = NULL; }
void pragha_hig_workarea_table_add_wide_tall_control(GtkWidget *table, guint *row, GtkWidget *widget) { gtk_grid_attach (GTK_GRID(table), widget, 0, *row, 2, 1); gtk_widget_set_margin_start (GTK_WIDGET(widget), 12); gtk_widget_set_hexpand (widget, TRUE); gtk_widget_set_vexpand (widget, TRUE); ++ * row; }
void style_set_margin_start(GtkWidget *widget, gint margin) { #if (GTK_MAJOR_VERSION > 3) || (GTK_MINOR_VERSION >= 12) gtk_widget_set_margin_start(widget, margin); #else if(gtk_widget_get_direction(widget) == GTK_TEXT_DIR_RTL) gtk_widget_set_margin_right(widget, margin); else gtk_widget_set_margin_left(widget, margin); #endif }
void clocksource (GtkWidget *box, GtkWidget *button) { GtkWidget *label; GtkWidget *pbutton; GtkWidget *child_box1; GtkWidget *separator; config_t config; GtkPassedClockSourceData *pdata; child_box1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); label = gtk_label_new ("Clocksource"); separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); pdata = g_slice_new (GtkPassedClockSourceData); pdata -> pbutton = gtk_button_new_with_label (get_clocksource ()); pdata -> popover = NULL; gtk_widget_set_tooltip_text (pdata -> pbutton, "Choose a specific wall clock."); gtk_button_set_relief (GTK_BUTTON (pdata -> pbutton), GTK_RELIEF_NONE); gtk_widget_override_font (label, pango_font_description_from_string ("Cantarell Bold 11.5")); //label_underline (label); /* Pack box. */ gtk_box_pack_start (GTK_BOX (child_box1), label, FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (child_box1), pdata -> pbutton, FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (child_box1), separator, FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (box), child_box1, FALSE, FALSE, 2); gtk_widget_set_size_request (pdata -> pbutton, 80, 10); gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_widget_set_margin_start (label, 10); gtk_widget_set_margin_start (pdata -> pbutton, 10); gtk_widget_set_margin_top (separator, 6); gtk_widget_set_margin_top (child_box1, 6); gtk_widget_set_name (pdata -> pbutton, "clocksource-button"); gtk_widget_set_name (label, "clocksource-label-title"); g_signal_connect (pdata -> pbutton, "clicked", G_CALLBACK (popover_button_clicked_cb), pdata); g_signal_connect (button, "clicked", G_CALLBACK (button_clicked_cb), pdata); }
static void gs_page_needs_user_action (GsPageHelper *helper, AsScreenshot *ss) { GtkWidget *content_area; GtkWidget *dialog; GtkWidget *ssimg; g_autofree gchar *escaped = NULL; GsPagePrivate *priv = gs_page_get_instance_private (helper->page); dialog = gtk_message_dialog_new (gs_shell_get_window (priv->shell), GTK_DIALOG_MODAL | GTK_DIALOG_USE_HEADER_BAR, GTK_MESSAGE_INFO, GTK_BUTTONS_CANCEL, /* TRANSLATORS: this is a prompt message, and * '%s' is an application summary, e.g. 'GNOME Clocks' */ _("Prepare %s"), gs_app_get_name (helper->app)); escaped = g_markup_escape_text (as_screenshot_get_caption (ss, NULL), -1); gtk_message_dialog_format_secondary_markup (GTK_MESSAGE_DIALOG (dialog), "%s", escaped); /* this will be enabled when the device is in the right mode */ helper->button_install = gtk_dialog_add_button (GTK_DIALOG (dialog), /* TRANSLATORS: update the fw */ _("Install"), GTK_RESPONSE_OK); helper->notify_quirk_id = g_signal_connect (helper->app, "notify::quirk", G_CALLBACK (gs_page_notify_quirk_cb), helper); gtk_widget_set_sensitive (helper->button_install, FALSE); /* load screenshot */ helper->soup_session = soup_session_new_with_options (SOUP_SESSION_USER_AGENT, gs_user_agent (), NULL); ssimg = gs_screenshot_image_new (helper->soup_session); gs_screenshot_image_set_screenshot (GS_SCREENSHOT_IMAGE (ssimg), ss); gs_screenshot_image_set_size (GS_SCREENSHOT_IMAGE (ssimg), 400, 225); gs_screenshot_image_load_async (GS_SCREENSHOT_IMAGE (ssimg), helper->cancellable); gtk_widget_set_margin_start (ssimg, 24); gtk_widget_set_margin_end (ssimg, 24); content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); gtk_container_add (GTK_CONTAINER (content_area), ssimg); gtk_container_child_set (GTK_CONTAINER (content_area), ssimg, "pack-type", GTK_PACK_END, NULL); /* handle this async */ g_signal_connect (dialog, "response", G_CALLBACK (gs_page_update_app_response_cb), helper); gs_shell_modal_dialog_present (priv->shell, GTK_DIALOG (dialog)); }
void pragha_hig_workarea_table_add_row(GtkWidget *table, guint *row, GtkWidget *label, GtkWidget *control) { gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); gtk_widget_set_margin_start (GTK_WIDGET(label), 12); gtk_grid_attach (GTK_GRID(table), label, 0, *row, 1, 1); gtk_grid_attach (GTK_GRID(table), control, 1, *row, 1, 1); gtk_widget_set_hexpand (control, TRUE); ++ * row; }
static GtkWidget * ipp_option_add (IPPAttribute *attr_supported, IPPAttribute *attr_default, const gchar *option_name, const gchar *option_display_name, const gchar *printer_name, GtkWidget *grid, gboolean sensitive) { GtkStyleContext *context; GtkWidget *widget; GtkWidget *label; gint position; widget = (GtkWidget *) pp_ipp_option_widget_new (attr_supported, attr_default, option_name, printer_name); if (widget) { gtk_widget_set_sensitive (widget, sensitive); position = grid_get_height (grid); label = gtk_label_new (option_display_name); context = gtk_widget_get_style_context (label); gtk_style_context_add_class (context, "dim-label"); gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); gtk_widget_set_margin_start (label, 10); gtk_grid_attach (GTK_GRID (grid), label, 0, position, 1, 1); gtk_widget_set_margin_start (widget, 20); gtk_grid_attach (GTK_GRID (grid), widget, 1, position, 1, 1); } return widget; }
void huayra_hig_workarea_table_add_row(GtkWidget *table, guint *row, GtkWidget *label, GtkWidget *control) { gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_widget_set_valign (label, GTK_ALIGN_CENTER); gtk_widget_set_margin_start (GTK_WIDGET(label), 12); gtk_grid_attach (GTK_GRID(table), label, 0, *row, 1, 1); gtk_grid_attach (GTK_GRID(table), control, 1, *row, 1, 1); gtk_widget_set_hexpand (control, TRUE); ++ * row; }
static GtkWidget * padded_label_new (char *text, gboolean narrow) { GtkWidget *widget; widget = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); gtk_widget_set_halign (widget, GTK_ALIGN_CENTER); gtk_widget_set_margin_top (widget, 10); gtk_widget_set_margin_bottom (widget, 10); gtk_widget_set_margin_start (widget, narrow ? 10 : 80); gtk_widget_set_margin_end (widget, narrow ? 10 : 80); gtk_box_pack_start (GTK_BOX (widget), gtk_label_new (text), FALSE, FALSE, 0); return widget; }
static void ekiga_window_init_status_toolbar (EkigaWindow *mw) { g_return_if_fail (EKIGA_IS_WINDOW (mw)); /* The main horizontal toolbar */ mw->priv->status_toolbar = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); mw->priv->status_option_menu = status_menu_new (gm_application_get_core (mw->priv->app)); status_menu_set_parent_window (STATUS_MENU (mw->priv->status_option_menu), GTK_WINDOW (mw)); gtk_box_pack_start (GTK_BOX (mw->priv->status_toolbar), mw->priv->status_option_menu, TRUE, TRUE, 0); gtk_widget_set_margin_start (mw->priv->status_option_menu, 0); gtk_widget_set_margin_end (mw->priv->status_option_menu, 0); gtk_widget_show_all (mw->priv->status_toolbar); }
static void nautilus_floating_bar_constructed (GObject *obj) { NautilusFloatingBar *self = NAUTILUS_FLOATING_BAR (obj); GtkWidget *w, *box, *labels_box; G_OBJECT_CLASS (nautilus_floating_bar_parent_class)->constructed (obj); box = GTK_WIDGET (obj); w = gtk_spinner_new (); gtk_box_pack_start (GTK_BOX (box), w, FALSE, FALSE, 0); gtk_widget_set_visible (w, self->show_spinner); gtk_spinner_start (GTK_SPINNER (w)); self->spinner = w; gtk_widget_set_size_request (w, 16, 16); gtk_widget_set_margin_start (w, 8); labels_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); gtk_box_pack_start (GTK_BOX (box), labels_box, TRUE, TRUE, 0); g_object_set (labels_box, "margin-top", 2, "margin-bottom", 2, "margin-start", 12, "margin-end", 12, NULL); gtk_widget_show (labels_box); w = gtk_label_new (NULL); gtk_label_set_ellipsize (GTK_LABEL (w), PANGO_ELLIPSIZE_MIDDLE); gtk_label_set_single_line_mode (GTK_LABEL (w), TRUE); gtk_container_add (GTK_CONTAINER (labels_box), w); self->primary_label_widget = w; gtk_widget_show (w); w = gtk_label_new (NULL); gtk_label_set_single_line_mode (GTK_LABEL (w), TRUE); gtk_container_add (GTK_CONTAINER (labels_box), w); self->details_label_widget = w; gtk_widget_show (w); }
static void cc_mouse_panel_init (CcMousePanel *self) { CcMousePanelPrivate *priv; priv = self->priv = MOUSE_PANEL_PRIVATE (self); g_resources_register (cc_mouse_get_resource ()); priv->prefs_widget = cc_mouse_properties_new (); priv->test_widget = cc_mouse_test_new (); gtk_widget_set_margin_start (priv->prefs_widget, 6); gtk_widget_set_margin_end (priv->prefs_widget, 6); gtk_widget_set_margin_top (priv->prefs_widget, 6); gtk_widget_set_margin_bottom (priv->prefs_widget, 6); gtk_container_add (GTK_CONTAINER (self), priv->prefs_widget); gtk_widget_show (priv->prefs_widget); gtk_widget_show (priv->test_widget); }
static void mtpc_statusbar_init(MtpcStatusbar *statusbar) { MtpcStatusbarPrivate *priv; priv = mtpc_statusbar_get_instance_private(statusbar); gtk_box_set_spacing(GTK_BOX(statusbar), 6); gtk_widget_set_margin_top(GTK_WIDGET(statusbar), 3); gtk_widget_set_margin_end(GTK_WIDGET(statusbar), 6); gtk_widget_set_margin_bottom(GTK_WIDGET(statusbar), 3); gtk_widget_set_margin_start(GTK_WIDGET(statusbar), 6); /* list info */ priv->list_info = gtk_label_new(NULL); gtk_label_set_ellipsize(GTK_LABEL(priv->list_info), PANGO_ELLIPSIZE_END); gtk_box_pack_start(GTK_BOX(statusbar), priv->list_info, FALSE, FALSE, 0); /* primary text */ priv->primary_text = gtk_label_new(NULL); gtk_label_set_ellipsize(GTK_LABEL(priv->primary_text), PANGO_ELLIPSIZE_END); gtk_box_pack_start(GTK_BOX(statusbar), priv->primary_text, FALSE, FALSE, 0); /* seconary text */ priv->secondary_text = gtk_label_new(NULL); gtk_label_set_ellipsize(GTK_LABEL(priv->secondary_text), PANGO_ELLIPSIZE_END); gtk_box_pack_start(GTK_BOX(statusbar), priv->secondary_text, FALSE, FALSE, 12); /* action area */ priv->action_area = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6); gtk_widget_show(priv->action_area); gtk_box_pack_end(GTK_BOX(statusbar), priv->action_area, FALSE, FALSE, 0); mtpc_statusbar_show_section(statusbar, MTPC_STATUSBAR_SECTION_FILE_LIST); }
static void add_access_point_other (GisNetworkPage *page) { GisNetworkPagePrivate *priv = gis_network_page_get_instance_private (page); GtkWidget *row; GtkWidget *widget; row = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12); gtk_widget_set_margin_start (row, 12); gtk_widget_set_margin_end (row, 12); widget = gtk_label_new (C_("Wireless access point", "Other…")); gtk_widget_set_margin_top (widget, 12); gtk_widget_set_margin_bottom (widget, 12); gtk_box_pack_start (GTK_BOX (row), widget, FALSE, FALSE, 0); gtk_widget_show_all (row); g_object_set_data (G_OBJECT (row), "object-path", "ap-other..."); g_object_set_data (G_OBJECT (row), "strength", GUINT_TO_POINTER (0)); gtk_container_add (GTK_CONTAINER (priv->network_list), row); }
static void gnc_period_select_set_date_common (GncPeriodSelect *period, const GDate *date) { GncPeriodSelectPrivate *priv; priv = GNC_PERIOD_SELECT_GET_PRIVATE(period); if (date) { if (priv->date_base) g_date_free(priv->date_base); priv->date_base = g_date_new_dmy(g_date_get_day(date), g_date_get_month(date), g_date_get_year(date)); if (priv->date_label == NULL) { priv->date_label = gtk_label_new(""); #if GTK_CHECK_VERSION(3,12,0) gtk_widget_set_margin_start (GTK_WIDGET(priv->date_label), 6); #else gtk_widget_set_margin_left (GTK_WIDGET(priv->date_label), 6); #endif gtk_box_pack_start(GTK_BOX(period), priv->date_label, TRUE, TRUE, 0); gtk_widget_show_all(priv->date_label); } gnc_period_sample_update_date_label(period); return; } if (priv->date_base) { g_date_free(priv->date_base); priv->date_base = NULL; gtk_widget_destroy(priv->date_label); priv->date_label = NULL; } }