forked from Razor-qt/razor-qt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:Razor-qt/razor-qt
- Loading branch information
Showing
12 changed files
with
225 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
razorqt-panel/plugin-desktopswitch/desktopswitchbutton.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* BEGIN_COMMON_COPYRIGHT_HEADER | ||
* | ||
* Razor - a lightweight, Qt based, desktop toolset | ||
* http://razor-qt.org | ||
* | ||
* Copyright: 2011 Razor team | ||
* Authors: | ||
* Petr Vanek <petr@scribus.info> | ||
* | ||
* This program or 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 3 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 | ||
* | ||
* END_COMMON_COPYRIGHT_HEADER */ | ||
|
||
|
||
#include <QToolButton> | ||
#include <QtDebug> | ||
#include <razorqxt/qxtglobalshortcut.h> | ||
|
||
#include "desktopswitchbutton.h" | ||
|
||
DesktopSwitchButton::DesktopSwitchButton(QWidget * parent, int index, const QKeySequence &sequence, const QString &title) | ||
: QToolButton(parent) | ||
{ | ||
QString mask("%1"); | ||
setText(mask.arg(index+1)); | ||
setCheckable(true); | ||
|
||
if (!sequence.isEmpty()) | ||
{ | ||
m_shortcut = new QxtGlobalShortcut(this); | ||
m_shortcut->setShortcut(sequence); | ||
connect(m_shortcut, SIGNAL(activated()), this, SIGNAL(activated())); | ||
} | ||
|
||
if (!title.isEmpty()) | ||
{ | ||
setToolTip(title); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* BEGIN_COMMON_COPYRIGHT_HEADER | ||
* | ||
* Razor - a lightweight, Qt based, desktop toolset | ||
* http://razor-qt.org | ||
* | ||
* Copyright: 2011 Razor team | ||
* Authors: | ||
* Petr Vanek <petr@scribus.info> | ||
* | ||
* This program or 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 3 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 | ||
* | ||
* END_COMMON_COPYRIGHT_HEADER */ | ||
|
||
|
||
#ifndef DESKTOPSWITCHBUTTON_H | ||
#define DESKTOPSWITCHBUTTON_H | ||
|
||
#include <QtGui/QToolButton> | ||
|
||
class QxtGlobalShortcut; | ||
|
||
class DesktopSwitchButton : public QToolButton | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
DesktopSwitchButton(QWidget * parent, int index, const QKeySequence &sequence, const QString &title=QString()); | ||
|
||
signals: | ||
void activated(); | ||
|
||
private: | ||
QxtGlobalShortcut * m_shortcut; | ||
}; | ||
|
||
#endif |