Skip to content

Commit

Permalink
Modify about dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamYuan committed Feb 1, 2021
1 parent e12bea0 commit 4432885
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 34 deletions.
22 changes: 13 additions & 9 deletions wintitle-dialogs.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,18 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "wintitle-dialogs.h"
#include "wintitle.h"

void wintitle_plugin_about(XfcePanelPlugin *plugin) {
const gchar *auth[] = {"AdamYuan <[email protected]>", NULL};
gtk_show_about_dialog(NULL, //
"license", "GNU General Public License version 2 (GPLv2)", //
"version", "0.0.1", //
"program-name", "Wintitle", //
"comments", _("Shows activate window title and icon."), //
"website", "https://github.com/AdamYuan/xfce4-wintitle-plugin", //
"copyright", _("Copyright \xc2\xa9 2021 Yitian Yuan (AdamYuan)\n"), //
"authors", auth, NULL);
const gchar *auth[] = {"Yitian Yuan (AdamYuan) <[email protected]>", NULL};
return gtk_show_about_dialog(NULL, //
"logo-icon-name", NULL, //
"license-type", GTK_LICENSE_LGPL_2_1_ONLY, //
"version", "0.0.1", //
"program-name", "Wintitle", //
"comments", _("Shows activate window title and icon."), //
"website", "https://github.com/AdamYuan/xfce4-wintitle-plugin", //
"copyright", _("Copyright \xc2\xa9 2021 Yitian Yuan (AdamYuan)\n"), //
"authors", auth, //
NULL);
}
30 changes: 5 additions & 25 deletions wintitle.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,14 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define DEFAULT_TITLE_MAX_CHARS 80
#define DEFAULT_SPACING 5
#define DEFAULT_MINI_ICON FALSE
#include <common/panel-private.h>
#include <common/panel-utils.h>
#include <common/panel-xfconf.h>
#include <libwnck/libwnck.h>
#include <libxfce4panel/xfce-panel-macros.h>
#include <libxfce4panel/xfce-panel-plugin-provider.h>
#include <libxfce4panel/xfce-panel-plugin.h>
#include <libxfce4util/libxfce4util.h>

#include "wintitle.h"
#include "wintitle-dialogs.h"

#define XFCE_TYPE_WINTITLE_PLUGIN (wintitle_plugin_get_type())
#define XFCE_WINTITLE_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), XFCE_TYPE_WINTITLE_PLUGIN, WintitlePlugin))
#define XFCE_WINTITLE_PLUGIN_CLASS(class) \
(G_TYPE_CHECK_CLASS_CAST((class), XFCE_TYPE_WINTITLE_PLUGIN, WintitlePluginClass))
#define IS_XFCE_WINTITLE_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), XFCE_TYPE_WINTITLE_PLUGIN))
#define IS_XFCE_WINTITLE_PLUGIN_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE((class), XFCE_TYPE_WINTITLE_PLUGIN))
#define XFCE_WINTITLE_PLUGIN_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS((obj), XFCE_TYPE_WINTITLE_PLUGIN), WintitlePluginClass)

typedef struct _WintitlePluginClass {
struct _WintitlePluginClass {
XfcePanelPluginClass __parent__;
} WintitlePluginClass;
};

typedef struct _WintitlePlugin {
struct _WintitlePlugin {
XfcePanelPlugin __parent__;

// Configuration
Expand All @@ -56,7 +36,7 @@ typedef struct _WintitlePlugin {

WnckScreen *screen;
WnckWindow *window;
} WintitlePlugin;
};

XFCE_PANEL_DEFINE_PLUGIN(WintitlePlugin, wintitle_plugin);

Expand Down
46 changes: 46 additions & 0 deletions wintitle.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Copyright (C) 2021 Yitian Yuan (AdamYuan)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef WINTITLE_H
#define WINTITLE_H

#define DEFAULT_TITLE_MAX_CHARS 80
#define DEFAULT_SPACING 5
#define DEFAULT_MINI_ICON FALSE
#include <common/panel-private.h>
#include <common/panel-utils.h>
#include <common/panel-xfconf.h>
#include <libwnck/libwnck.h>
#include <libxfce4panel/xfce-panel-macros.h>
#include <libxfce4panel/xfce-panel-plugin-provider.h>
#include <libxfce4panel/xfce-panel-plugin.h>
#include <libxfce4util/libxfce4util.h>

#include "wintitle-dialogs.h"

#define XFCE_TYPE_WINTITLE_PLUGIN (wintitle_plugin_get_type())
#define XFCE_WINTITLE_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), XFCE_TYPE_WINTITLE_PLUGIN, WintitlePlugin))
#define XFCE_WINTITLE_PLUGIN_CLASS(class) \
(G_TYPE_CHECK_CLASS_CAST((class), XFCE_TYPE_WINTITLE_PLUGIN, WintitlePluginClass))
#define IS_XFCE_WINTITLE_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), XFCE_TYPE_WINTITLE_PLUGIN))
#define IS_XFCE_WINTITLE_PLUGIN_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE((class), XFCE_TYPE_WINTITLE_PLUGIN))
#define XFCE_WINTITLE_PLUGIN_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS((obj), XFCE_TYPE_WINTITLE_PLUGIN), WintitlePluginClass)

typedef struct _WintitlePluginClass WintitlePluginClass;
typedef struct _WintitlePlugin WintitlePlugin;
#endif

0 comments on commit 4432885

Please sign in to comment.