Blame src/terminal-icon-button.c

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