1 /**********************************************************************************************
2     Copyright (C) 2016 Christian Eichler <code@christian-eichler.de>
3 
4     This program is free software: you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation, either version 3 of the License, or
7     (at your option) any later version.
8 
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13 
14     You should have received a copy of the GNU General Public License
15     along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 
17 **********************************************************************************************/
18 
19 
20 #include "CTextEditWidgetSelMenu.h"
21 #include "helpers/Signals.h"
22 
23 #include <QtWidgets>
24 
CTextEditWidgetSelMenu(QWidget * parent,QAction * actionTextBold,QAction * actionTextItalic,QAction * actionTextUnderline,QAction * actionCut,QAction * actionCopy,QAction * actionPaste)25 CTextEditWidgetSelMenu::CTextEditWidgetSelMenu(QWidget* parent,
26                                                QAction* actionTextBold, QAction* actionTextItalic, QAction* actionTextUnderline,
27                                                QAction* actionCut, QAction* actionCopy, QAction* actionPaste
28                                                )
29     : QWidget(parent, Qt::Tool | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint)
30 {
31     setupUi(this);
32 
33     toolBold->setDefaultAction(actionTextBold);
34     toolItalic->setDefaultAction(actionTextItalic);
35     toolUnder->setDefaultAction(actionTextUnderline);
36 
37     toolCut->setDefaultAction(actionCut);
38     toolCopy->setDefaultAction(actionCopy);
39     toolPaste->setDefaultAction(actionPaste);
40 
41     QRect geo = childrenRect();
42     geo.adjust(0, 0, 0, 1);
43     setGeometry(geo);
44 }
45 
46