1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

refactor(buttons): Mic and vol buttons now are QToolButton

This commit is contained in:
Diadlo 2016-12-25 13:55:23 +03:00 committed by Zetok Zalbavar
parent ece4d9e446
commit 2aed859bdb
No known key found for this signature in database
GPG Key ID: C953D3880212068A
7 changed files with 59 additions and 42 deletions

View File

@ -27,6 +27,7 @@
#include <QShortcut> #include <QShortcut>
#include <QSplitter> #include <QSplitter>
#include <QClipboard> #include <QClipboard>
#include <QToolButton>
#include "src/chatlog/chatlog.h" #include "src/chatlog/chatlog.h"
#include "src/chatlog/content/timestamp.h" #include "src/chatlog/content/timestamp.h"
@ -109,10 +110,10 @@ GenericChatForm::GenericChatForm(QWidget *parent)
videoButton = new QPushButton(); videoButton = new QPushButton();
videoButton->setFixedSize(50,40); videoButton->setFixedSize(50,40);
volButton = new QPushButton(); volButton = new QToolButton();
volButton->setFixedSize(22, 18); volButton->setFixedSize(22, 18);
micButton = new QPushButton(); micButton = new QToolButton();
micButton->setFixedSize(22, 18); micButton->setFixedSize(22, 18);
// TODO: Make updateCallButtons (see ChatForm) abstract // TODO: Make updateCallButtons (see ChatForm) abstract
// and call here to set tooltips. // and call here to set tooltips.

View File

@ -48,6 +48,7 @@ class FlyoutOverlayWidget;
class ContentLayout; class ContentLayout;
class QSplitter; class QSplitter;
class GenericNetCamView; class GenericNetCamView;
class QToolButton;
namespace Ui { namespace Ui {
class MainWindow; class MainWindow;
@ -124,8 +125,10 @@ protected:
int curRow; int curRow;
CroppingLabel *nameLabel; CroppingLabel *nameLabel;
MaskablePixmapWidget *avatar; MaskablePixmapWidget *avatar;
QWidget* headWidget; QWidget *headWidget;
QPushButton *fileButton, *screenshotButton, *emoteButton, *callButton, *videoButton, *volButton, *micButton; QPushButton* fileButton, *screenshotButton, *emoteButton, *callButton;
QPushButton* videoButton;
QToolButton *volButton, *micButton;
FlyoutOverlayWidget *fileFlyout; FlyoutOverlayWidget *fileFlyout;
QVBoxLayout *headTextLayout; QVBoxLayout *headTextLayout;
ChatTextEdit *msgEdit; ChatTextEdit *msgEdit;

View File

@ -22,6 +22,7 @@
#include <QDragEnterEvent> #include <QDragEnterEvent>
#include <QMimeData> #include <QMimeData>
#include <QTimer> #include <QTimer>
#include <QToolButton>
#include "tabcompleter.h" #include "tabcompleter.h"
#include "src/group.h" #include "src/group.h"

View File

@ -1,8 +1,12 @@
QToolButton
{
image: url(":/ui/micButton/micButton.svg");
}
QAbstractButton QAbstractButton
{ {
border-radius: 5px; border-radius: 5px;
border: none; border: none;
background-image: url(":/ui/micButton/micButton.svg");
background-repeat: none; background-repeat: none;
background-position: center; background-position: center;
} }

View File

@ -24,7 +24,7 @@
<dc:format>image/svg+xml</dc:format> <dc:format>image/svg+xml</dc:format>
<dc:type <dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title /> <dc:title></dc:title>
</cc:Work> </cc:Work>
</rdf:RDF> </rdf:RDF>
</metadata> </metadata>
@ -40,19 +40,19 @@
inkscape:pageopacity="0" inkscape:pageopacity="0"
inkscape:pageshadow="2" inkscape:pageshadow="2"
inkscape:window-width="1280" inkscape:window-width="1280"
inkscape:window-height="963" inkscape:window-height="965"
id="namedview4869" id="namedview4869"
showgrid="false" showgrid="false"
inkscape:zoom="22.627418" inkscape:zoom="22.627418"
inkscape:cx="13.694084" inkscape:cx="11.743876"
inkscape:cy="12.845575" inkscape:cy="5.7111464"
inkscape:window-x="0" inkscape:window-x="0"
inkscape:window-y="106" inkscape:window-y="96"
inkscape:window-maximized="1" inkscape:window-maximized="1"
inkscape:current-layer="svg4867" /> inkscape:current-layer="svg4867" />
<g <g
id="g4144" id="g4144"
transform="matrix(0.76,0,0,0.76,3.3064861,2.7057204)"> transform="matrix(1.1244169,0,0,1.1264917,-1.7361911,-1.4498809)">
<rect <rect
ry="2.6881006" ry="2.6881006"
y="1.2870765" y="1.2870765"

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -1,8 +1,12 @@
QToolButton
{
image: url(":/ui/volButton/volButton.svg");
}
QAbstractButton QAbstractButton
{ {
border-radius: 5px; border-radius: 5px;
border: none; border: none;
background-image: url(":/ui/volButton/volButton.svg");
background-repeat: none; background-repeat: none;
background-position: center; background-position: center;
} }

View File

@ -40,40 +40,44 @@
inkscape:pageopacity="0" inkscape:pageopacity="0"
inkscape:pageshadow="2" inkscape:pageshadow="2"
inkscape:window-width="1280" inkscape:window-width="1280"
inkscape:window-height="963" inkscape:window-height="965"
id="namedview5874" id="namedview5874"
showgrid="false" showgrid="false"
inkscape:zoom="22.627417" inkscape:zoom="22.627417"
inkscape:cx="12.49006" inkscape:cx="11.342775"
inkscape:cy="3.1865007" inkscape:cy="5.7587929"
inkscape:window-x="0" inkscape:window-x="0"
inkscape:window-y="106" inkscape:window-y="96"
inkscape:window-maximized="1" inkscape:window-maximized="1"
inkscape:current-layer="svg5872" /> inkscape:current-layer="svg5872" />
<rect <g
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1.89999998;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" id="g3465"
id="rect6422" transform="matrix(1.1540409,0,0,1.1540409,-0.84812976,-1.3955943)">
width="5.2330775" <rect
height="5.5364447" rx="1.281631"
x="1.8454813" ry="1.4363106"
y="5.6757092" y="5.6757092"
ry="1.4363106" x="1.8454813"
rx="1.281631" /> height="5.5364447"
<path width="5.2330775"
style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:1px;stroke-linecap:round;stroke-linejoin:bevel;stroke-opacity:1" id="rect6422"
d="m 13.014741,4.9931342 c 0,0 2.696002,3.0409607 0,7.7105728" style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1.89999998;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
id="path6434" <path
inkscape:connector-curvature="0" /> inkscape:connector-curvature="0"
<path id="path6434"
style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1" d="m 13.014741,4.9931342 c 0,0 2.696002,3.0409607 0,7.7105728"
d="m 15.269462,2.9706889 c 0,0 4.044848,4.3654114 0,10.8453631" style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:1px;stroke-linecap:round;stroke-linejoin:bevel;stroke-opacity:1" />
id="path6438" <path
inkscape:connector-curvature="0" sodipodi:nodetypes="cc"
sodipodi:nodetypes="cc" /> inkscape:connector-curvature="0"
<path id="path6438"
sodipodi:nodetypes="ccccc" d="m 15.269462,2.9706889 c 0,0 4.044848,4.3654114 0,10.8453631"
inkscape:connector-curvature="0" style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1" />
id="path4750" <path
d="M 6.337401,6.1307596 10.26,2.246 l 0,12.586 -4.0174011,-4.384584 z" style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> d="M 6.337401,6.1307596 10.26,2.246 l 0,12.586 -4.0174011,-4.384584 z"
id="path4750"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc" />
</g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB