Blame src/terminal-icon-button.c

Packit d370c2
/*
Packit d370c2
 * terminal-icon-button.c
Packit d370c2
 *
Packit d370c2
 * Copyright © 2010 - Paolo Borelli
Packit d370c2
 * Copyright © 2011 - Ignacio Casal Quinteiro
Packit d370c2
 *
Packit d370c2
 * This program is free software: you can redistribute it and/or modify
Packit d370c2
 * it under the terms of the GNU General Public License as published by
Packit d370c2
 * the Free Software Foundation, either version 3 of the License, or
Packit d370c2
 * (at your option) any later version.
Packit d370c2
 *
Packit d370c2
 * This program is distributed in the hope that it will be useful,
Packit d370c2
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit d370c2
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit d370c2
 * GNU General Public License for more details.
Packit d370c2
 *
Packit d370c2
 * You should have received a copy of the GNU General Public License
Packit d370c2
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit d370c2
 */
Packit d370c2
Packit d370c2
#include "config.h"
Packit d370c2
Packit d370c2
#include "terminal-icon-button.h"
Packit d370c2
#include "terminal-libgsystem.h"
Packit d370c2
Packit d370c2
GtkWidget *
Packit d370c2
terminal_icon_button_new (const char *gicon_name)
Packit d370c2
{
Packit d370c2
  GtkWidget *button, *image;
Packit d370c2
  gs_unref_object GIcon *icon;
Packit d370c2
Packit d370c2
  button = (GtkWidget *) g_object_new (GTK_TYPE_BUTTON,
Packit d370c2
                                       "relief", GTK_RELIEF_NONE,
Packit d370c2
                                       "focus-on-click", FALSE,
Packit d370c2
                                       NULL);
Packit d370c2
Packit d370c2
  icon = g_themed_icon_new_with_default_fallbacks (gicon_name);
Packit d370c2
  image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_MENU);
Packit d370c2
Packit d370c2
  gtk_widget_show (image);
Packit d370c2
  gtk_container_add (GTK_CONTAINER (button), image);
Packit d370c2
Packit d370c2
  return button;
Packit d370c2
}
Packit d370c2
Packit d370c2
GtkWidget *
Packit d370c2
terminal_close_button_new (void)
Packit d370c2
{
Packit d370c2
  return terminal_icon_button_new ("window-close-symbolic");
Packit d370c2
}