mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55:28 +00:00
use separated class files, use hpp header extension, update include model
This commit is contained in:
parent
9b6dceddd8
commit
0f96ff851e
15 changed files with 235 additions and 145 deletions
48
src/app/browser/header/menu.cpp
Normal file
48
src/app/browser/header/menu.cpp
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
#include "menu.hpp"
|
||||
|
||||
using namespace app::browser::header;
|
||||
|
||||
Menu::Menu()
|
||||
{
|
||||
set_tooltip_text(
|
||||
TOOLTIP
|
||||
);
|
||||
|
||||
// Build tab submenu
|
||||
auto tab = Gio::Menu::create();
|
||||
|
||||
tab->append(
|
||||
_("New tab"),
|
||||
"app.tab.new"
|
||||
);
|
||||
|
||||
// Build tool submenu
|
||||
auto tool = Gio::Menu::create();
|
||||
|
||||
tool->append(
|
||||
_("Debug"),
|
||||
"app.tool.debug"
|
||||
);
|
||||
|
||||
// Build main menu
|
||||
auto main = Gio::Menu::create();
|
||||
|
||||
main->append_submenu(
|
||||
_("Tab"),
|
||||
tab
|
||||
);
|
||||
|
||||
main->append_submenu(
|
||||
_("Tool"),
|
||||
tool
|
||||
);
|
||||
|
||||
main->append(
|
||||
_("Quit"),
|
||||
"win.quit"
|
||||
);
|
||||
|
||||
set_menu_model(
|
||||
main
|
||||
);
|
||||
}
|
||||
21
src/app/browser/header/menu.hpp
Normal file
21
src/app/browser/header/menu.hpp
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#ifndef APP_BROWSER_HEADER_MENU_H
|
||||
#define APP_BROWSER_HEADER_MENU_H
|
||||
|
||||
#include <giomm/menu.h>
|
||||
|
||||
#include <glibmm/i18n.h>
|
||||
#include <gtkmm/menubutton.h>
|
||||
|
||||
namespace app::browser::header
|
||||
{
|
||||
class Menu : public Gtk::MenuButton
|
||||
{
|
||||
public:
|
||||
|
||||
const char* TOOLTIP = _("Menu");
|
||||
|
||||
Menu();
|
||||
};
|
||||
}
|
||||
|
||||
#endif // APP_BROWSER_HEADER_MENU_H
|
||||
14
src/app/browser/header/tab.cpp
Normal file
14
src/app/browser/header/tab.cpp
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#include "tab.hpp"
|
||||
|
||||
using namespace app::browser::header;
|
||||
|
||||
Tab::Tab()
|
||||
{
|
||||
set_tooltip_text(
|
||||
TOOLTIP
|
||||
);
|
||||
|
||||
set_icon_name(
|
||||
ICON
|
||||
);
|
||||
}
|
||||
20
src/app/browser/header/tab.hpp
Normal file
20
src/app/browser/header/tab.hpp
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#ifndef APP_BROWSER_HEADER_TAB_H
|
||||
#define APP_BROWSER_HEADER_TAB_H
|
||||
|
||||
#include <glibmm/i18n.h>
|
||||
#include <gtkmm/menubutton.h>
|
||||
|
||||
namespace app::browser::header
|
||||
{
|
||||
class Tab : public Gtk::MenuButton
|
||||
{
|
||||
public:
|
||||
|
||||
const char* ICON = "tab-new-symbolic";
|
||||
const char* TOOLTIP = _("New tab");
|
||||
|
||||
Tab();
|
||||
};
|
||||
}
|
||||
|
||||
#endif // APP_BROWSER_HEADER_TAB_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue