mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
PhaseButton added
This commit is contained in:
parent
f238b59935
commit
08a5338e9b
3 changed files with 135 additions and 16 deletions
39
cockatrice/src/phasebutton.cpp
Normal file
39
cockatrice/src/phasebutton.cpp
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#include "phasebutton.h"
|
||||
#include <QPainter>
|
||||
#include <QPen>
|
||||
//
|
||||
PhaseButton::PhaseButton(QIcon icon, QString name )
|
||||
: QPushButton(icon,name)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//PhaseButton::PhaseButton( )
|
||||
//: QPushButton()
|
||||
//{
|
||||
//
|
||||
//}
|
||||
|
||||
void PhaseButton::update()
|
||||
{
|
||||
QPushButton::update();
|
||||
}
|
||||
|
||||
void PhaseButton::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
QPushButton::paintEvent(event);
|
||||
if(isChecked())
|
||||
{
|
||||
QPainter painter(this);
|
||||
int height = size().height();
|
||||
int width = size().width();
|
||||
QPen pen;
|
||||
pen.setWidth(3);
|
||||
pen.setColor(QColor::fromRgb(180,0,0));
|
||||
painter.setPen(pen);
|
||||
painter.drawRect(3,3, width-7, height-7);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//
|
||||
Loading…
Add table
Add a link
Reference in a new issue