-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGuiMenu.h
141 lines (121 loc) · 3.07 KB
/
GuiMenu.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
/*
* Copyright (C) 2013 Rajendran Thirupugalsamy
* See LICENSE for full copyright and license information.
* See COPYING for distribution information.
*/
#ifndef GUIMENU_H
#define GUIMENU_H
#include <QString>
#include <QKeySequence>
#include <QToolButton>
#include <QToolBar>
class GuiMainWindow;
class GuiTerminalWindow;
enum qutty_menu_id_t {
/*
* These indexes will be saved in xml config file
* Don't change the order of the entries
* Insert new items only at the end
*/
MENU_RESTART_SESSION,
MENU_DUPLICATE_SESSION,
MENU_CHANGE_SETTINGS,
MENU_PASTE,
MENU_NEW_TAB,
MENU_NEW_WINDOW,
MENU_CLOSE_SESSION,
MENU_SPLIT_HORIZONTAL,
MENU_SPLIT_VERTICAL,
MENU_DUPLICATE_HSPLIT,
MENU_DUPLICATE_VSPLIT,
MENU_SWITCH_LEFT_TAB,
MENU_SWITCH_RIGHT_TAB,
MENU_SWITCH_UP_PANE,
MENU_SWITCH_BOTTOM_PANE,
MENU_SWITCH_LEFT_PANE,
MENU_SWITCH_RIGHT_PANE,
MENU_SWITCH_MRU_TAB,
MENU_SWITCH_LRU_TAB,
MENU_SWITCH_MRU_PANE,
MENU_SWITCH_LRU_PANE,
MENU_IMPORT_FILE,
MENU_IMPORT_REGISTRY,
MENU_EXPORT_FILE,
MENU_EXIT,
MENU_MENUBAR,
MENU_FULLSCREEN,
MENU_ALWAYSONTOP,
MENU_PREFERENCES,
MENU_RENAME_TAB,
MENU_FIND,
MENU_FIND_NEXT,
MENU_FIND_PREVIOUS,
MENU_FIND_CASE_INSENSITIVE,
MENU_FIND_REGEX,
MENU_FIND_HIGHLIGHT,
MENU_TAB_IN_TITLE_BAR,
MENU_AUTO_COMPLETE_LIST,
MENU_PASTE_HISTORY,
MENU_CALCULATOR,
/*
* Insert any new actions before this comment
*/
MENU_STATIC_ACTION_MAX,
MENU_CUSTOM_OPEN_SAVED_SESSION = 100000,
MENU_CUSTOM_OPEN_SAVED_SESSION_END = 200000,
MENU_CUSTOM_ACTION_MAX,
MENU_MAX_ACTION = MENU_CUSTOM_ACTION_MAX,
MENU_SEPARATOR = 100000000,
/*
* These indexes will be saved in xml config file
* Don't change the order of the entries
* Insert new items only at the end
*/
MENU_FILE,
MENU_EDIT,
MENU_VIEW,
MENU_EXPORT_IMPORT,
MENU_SAVED_SESSIONS,
MENU_SPLIT_SESSION,
MENU_TERM_WINDOW,
MENU_TAB_BAR,
MENU_FIND_OPTIONS,
/*
* Insert any new menus before this comment
*/
MENU_ID_LAST
};
#define MENU_MAX_MENU (MENU_ID_LAST - MENU_SEPARATOR - 1)
struct qutty_menu_actions_t {
const char *name;
const char *key;
const char *slot;
const char *tooltip;
};
struct qutty_menu_links_t {
const char *name;
int len;
qutty_menu_id_t links[20];
};
extern qutty_menu_actions_t qutty_menu_actions[];
extern qutty_menu_links_t qutty_menu_links[];
class GuiToolbarTerminalTop : public QToolBar {
Q_OBJECT
enum {
MENU_TERMTOP_MENU,
MENU_TERMTOP_MOVE,
MENU_TERMTOP_CLOSE,
MENU_TERMTOP_MAX_SIZE
};
bool menuVisible;
bool initSizes;
int totalWidth;
int totalHeight;
public:
QToolButton btns[MENU_TERMTOP_MAX_SIZE];
GuiToolbarTerminalTop(GuiMainWindow *p);
void hideMe();
void initializeToolbarTerminalTop(GuiMainWindow *p);
void processMouseMoveTerminalTop(GuiTerminalWindow *term, QMouseEvent *e);
};
#endif // GUIMENU_H