2006-03-05 17:24:44 +00:00
|
|
|
/**
|
2007-08-31 05:53:55 +00:00
|
|
|
* \file GuiSetBorder.cpp
|
2006-03-05 17:24:44 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Edwin Leuven
|
|
|
|
* \author John Levon
|
2019-04-03 07:59:52 +02:00
|
|
|
* \author Jürgen Spitzmüller
|
2006-03-05 17:24:44 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
#include "GuiSetBorder.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2019-04-03 07:59:52 +02:00
|
|
|
#include "support/debug.h"
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
#include <QPainter>
|
|
|
|
#include <QMouseEvent>
|
|
|
|
#include <QPaintEvent>
|
|
|
|
|
|
|
|
|
2012-11-10 13:34:45 +01:00
|
|
|
GuiSetBorder::GuiSetBorder(QWidget * parent, Qt::WindowFlags fl)
|
2019-04-03 07:59:52 +02:00
|
|
|
: QWidget(parent, fl), buffer(75, 75), bottom_drawn_wide_(false),
|
|
|
|
top_drawn_wide_(false)
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
|
|
|
/* length of corner line */
|
2019-04-03 07:59:52 +02:00
|
|
|
corner_length = buffer.width() / 10;
|
2006-03-05 17:24:44 +00:00
|
|
|
/* margin */
|
2019-04-03 07:59:52 +02:00
|
|
|
margin = buffer.height() / 10;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2019-04-03 07:59:52 +02:00
|
|
|
bwidth = buffer.width();
|
|
|
|
bheight = buffer.height();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
init();
|
|
|
|
|
2019-04-03 07:59:52 +02:00
|
|
|
setMinimumSize(bwidth, bheight);
|
|
|
|
setMaximumSize(bwidth, bheight);
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
void GuiSetBorder::paintEvent(QPaintEvent * e)
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
|
|
|
QWidget::paintEvent(e);
|
2006-08-15 14:55:34 +00:00
|
|
|
QPainter painter(this);
|
|
|
|
painter.drawPixmap(0, 0, buffer);
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
void GuiSetBorder::init()
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
|
|
|
buffer.fill();
|
|
|
|
QPainter paint(&buffer);
|
|
|
|
|
|
|
|
paint.setPen(Qt::black);
|
|
|
|
|
2019-04-03 07:59:52 +02:00
|
|
|
// Draw the corner marks
|
|
|
|
paint.drawLine(margin + corner_length, margin,
|
|
|
|
margin + corner_length, margin + corner_length);
|
|
|
|
paint.drawLine(bwidth - (margin + corner_length), margin,
|
|
|
|
bwidth - (margin + corner_length), margin + corner_length);
|
|
|
|
|
|
|
|
paint.drawLine(margin, margin + corner_length,
|
|
|
|
margin + corner_length, margin + corner_length);
|
|
|
|
paint.drawLine(margin, bheight - (margin + corner_length),
|
|
|
|
margin + corner_length, bheight - (margin + corner_length));
|
|
|
|
|
|
|
|
paint.drawLine(margin + corner_length ,bheight - margin,
|
|
|
|
margin + corner_length ,bheight - (margin + corner_length));
|
|
|
|
paint.drawLine(bwidth - (margin + corner_length), bheight - margin,
|
|
|
|
bwidth - (margin + corner_length), bheight - (margin + corner_length));
|
|
|
|
|
|
|
|
paint.drawLine(bheight - margin, margin+corner_length,
|
|
|
|
bheight - (margin + corner_length), margin + corner_length);
|
|
|
|
paint.drawLine(bheight - margin, bheight - (margin + corner_length),
|
|
|
|
bheight - (margin + corner_length),bheight - (margin + corner_length));
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
void GuiSetBorder::mousePressEvent(QMouseEvent * e)
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
|
|
|
if (e->y() > e->x()) {
|
|
|
|
if (e->y() < height() - e->x()) {
|
|
|
|
if (left_.enabled) {
|
2018-07-24 13:49:27 +02:00
|
|
|
setLeft(left_.set == LINE_SET ? LINE_UNSET : LINE_SET);
|
2007-05-28 22:27:45 +00:00
|
|
|
// emit signal
|
2018-07-24 13:49:27 +02:00
|
|
|
leftSet();
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
} else {
|
2019-04-03 07:59:52 +02:00
|
|
|
if (bottom_trim_left_.enabled && e->x() < margin + 4 + 2 * corner_length) {
|
|
|
|
setBottomLeftTrim(bottom_trim_left_.set == LINE_SET ? LINE_UNSET : LINE_SET);
|
|
|
|
// emit signal
|
|
|
|
bottomLTSet();
|
|
|
|
} else if (bottom_trim_right_.enabled && e->x() > bwidth - margin - 2 * corner_length - 4) {
|
|
|
|
setBottomRightTrim(bottom_trim_right_.set == LINE_SET ? LINE_UNSET : LINE_SET);
|
|
|
|
// emit signal
|
|
|
|
bottomRTSet();
|
|
|
|
} else if (bottom_.enabled) {
|
2018-07-24 13:49:27 +02:00
|
|
|
setBottom(bottom_.set == LINE_SET ? LINE_UNSET : LINE_SET);
|
2007-05-28 22:27:45 +00:00
|
|
|
// emit signal
|
2018-07-24 13:49:27 +02:00
|
|
|
bottomSet();
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (e->y() < height() - e->x()) {
|
2019-04-03 07:59:52 +02:00
|
|
|
if (top_trim_left_.enabled && e->x() < margin + 4 + 2 * corner_length) {
|
|
|
|
setTopLeftTrim(top_trim_left_.set == LINE_SET ? LINE_UNSET : LINE_SET);
|
|
|
|
// emit signal
|
|
|
|
topLTSet();
|
|
|
|
} else if (top_trim_right_.enabled && e->x() > bwidth - margin - 2 * corner_length - 4) {
|
|
|
|
setTopRightTrim(top_trim_right_.set == LINE_SET ? LINE_UNSET : LINE_SET);
|
|
|
|
// emit signal
|
|
|
|
topRTSet();
|
|
|
|
} else if (top_.enabled) {
|
2018-07-24 13:49:27 +02:00
|
|
|
setTop(top_.set == LINE_SET ? LINE_UNSET : LINE_SET);
|
2007-05-28 22:27:45 +00:00
|
|
|
// emit signal
|
2018-07-24 13:49:27 +02:00
|
|
|
topSet();
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (right_.enabled) {
|
2018-07-24 13:49:27 +02:00
|
|
|
setRight(right_.set == LINE_SET ? LINE_UNSET : LINE_SET);
|
2007-05-28 22:27:45 +00:00
|
|
|
// emit signal
|
2018-07-24 13:49:27 +02:00
|
|
|
rightSet();
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
update();
|
2007-05-28 22:27:45 +00:00
|
|
|
// emit signal
|
2006-06-30 14:11:50 +00:00
|
|
|
clicked();
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
void GuiSetBorder::drawLine(QColor const & col, int x, int y, int x2, int y2)
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
|
|
|
QPainter paint(&buffer);
|
|
|
|
QPen p = paint.pen();
|
|
|
|
p.setWidth(2);
|
|
|
|
p.setColor(col);
|
|
|
|
paint.setPen(p);
|
|
|
|
paint.drawLine(x, y, x2, y2);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-07-24 13:49:27 +02:00
|
|
|
void GuiSetBorder::drawLeft(BorderState draw)
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2018-07-24 13:49:27 +02:00
|
|
|
QColor col;
|
|
|
|
switch (draw) {
|
|
|
|
case LINE_SET:
|
|
|
|
col = Qt::black;
|
|
|
|
break;
|
|
|
|
case LINE_UNSET:
|
|
|
|
col = Qt::white;
|
|
|
|
break;
|
|
|
|
case LINE_UNDECIDED:
|
|
|
|
case LINE_UNDEF:
|
|
|
|
col = Qt::lightGray;
|
|
|
|
break;
|
|
|
|
}
|
2006-03-05 17:24:44 +00:00
|
|
|
if (!left_.enabled)
|
2010-01-31 13:15:26 +00:00
|
|
|
col = QColor(Qt::lightGray);
|
2019-04-03 07:59:52 +02:00
|
|
|
drawLine(col, margin + corner_length, margin + corner_length + 2,
|
|
|
|
margin + corner_length, bheight - margin - corner_length - 1);
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-07-24 13:49:27 +02:00
|
|
|
void GuiSetBorder::drawRight(BorderState draw)
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2018-07-24 13:49:27 +02:00
|
|
|
QColor col;
|
|
|
|
switch (draw) {
|
|
|
|
case LINE_SET:
|
|
|
|
col = Qt::black;
|
|
|
|
break;
|
|
|
|
case LINE_UNSET:
|
|
|
|
col = Qt::white;
|
|
|
|
break;
|
|
|
|
case LINE_UNDECIDED:
|
|
|
|
case LINE_UNDEF:
|
|
|
|
col = Qt::lightGray;
|
|
|
|
break;
|
|
|
|
}
|
2006-03-05 17:24:44 +00:00
|
|
|
if (!right_.enabled)
|
2010-01-31 13:15:26 +00:00
|
|
|
col = QColor(Qt::lightGray);
|
2019-04-03 07:59:52 +02:00
|
|
|
drawLine(col, bheight - margin - corner_length + 1, margin + corner_length + 2,
|
|
|
|
bheight - margin - corner_length + 1, bheight - margin - corner_length - 1);
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-07-24 13:49:27 +02:00
|
|
|
void GuiSetBorder::drawTop(BorderState draw)
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2018-07-24 13:49:27 +02:00
|
|
|
QColor col;
|
|
|
|
switch (draw) {
|
|
|
|
case LINE_SET:
|
|
|
|
col = Qt::black;
|
2019-04-03 07:59:52 +02:00
|
|
|
top_drawn_wide_ = true;
|
2018-07-24 13:49:27 +02:00
|
|
|
break;
|
|
|
|
case LINE_UNSET:
|
|
|
|
col = Qt::white;
|
2019-04-03 07:59:52 +02:00
|
|
|
top_drawn_wide_ = false;
|
2018-07-24 13:49:27 +02:00
|
|
|
break;
|
|
|
|
case LINE_UNDECIDED:
|
|
|
|
case LINE_UNDEF:
|
|
|
|
col = Qt::lightGray;
|
2019-04-03 07:59:52 +02:00
|
|
|
top_drawn_wide_ = true;
|
2018-07-24 13:49:27 +02:00
|
|
|
break;
|
|
|
|
}
|
2006-03-05 17:24:44 +00:00
|
|
|
if (!top_.enabled)
|
2010-01-31 13:15:26 +00:00
|
|
|
col = QColor(Qt::lightGray);
|
2019-04-03 07:59:52 +02:00
|
|
|
int const lt = (top_trim_left_.enabled) ? corner_length + 4 : 0;
|
|
|
|
int const rt = (top_trim_right_.enabled) ? corner_length + 4 : 0;
|
|
|
|
drawLine(col, margin + corner_length + 2 + lt, margin + corner_length,
|
|
|
|
bwidth - margin - corner_length - 1 - rt, margin + corner_length);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-08-13 17:04:42 +02:00
|
|
|
void GuiSetBorder::undrawWideTopLine(bool const right)
|
2019-04-03 07:59:52 +02:00
|
|
|
{
|
2019-08-13 17:04:42 +02:00
|
|
|
if (!top_drawn_wide_ && !right)
|
2019-04-03 07:59:52 +02:00
|
|
|
return;
|
|
|
|
|
|
|
|
// Overpaint previous lines white
|
2019-08-13 17:04:42 +02:00
|
|
|
if (right)
|
|
|
|
drawLine(Qt::white, margin + 2 * (corner_length + 2), margin + corner_length,
|
|
|
|
bwidth - margin - corner_length - 1, margin + corner_length);
|
|
|
|
else
|
|
|
|
drawLine(Qt::white, margin + corner_length + 2, margin + corner_length,
|
|
|
|
bwidth - margin - corner_length - 1, margin + corner_length);
|
2019-04-03 07:59:52 +02:00
|
|
|
top_drawn_wide_ = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GuiSetBorder::drawTopLeftTrim(BorderState draw)
|
|
|
|
{
|
|
|
|
QColor col;
|
|
|
|
switch (draw) {
|
|
|
|
case LINE_SET:
|
|
|
|
col = Qt::black;
|
|
|
|
break;
|
|
|
|
case LINE_UNSET:
|
|
|
|
col = Qt::white;
|
|
|
|
break;
|
|
|
|
case LINE_UNDECIDED:
|
|
|
|
case LINE_UNDEF:
|
|
|
|
col = Qt::lightGray;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (!top_trim_left_.enabled)
|
|
|
|
col = QColor(Qt::white);
|
|
|
|
int const lt = corner_length;
|
|
|
|
if (top_trim_left_.enabled)
|
|
|
|
drawLine(col, margin + corner_length + 2, margin + corner_length,
|
|
|
|
margin + corner_length + 2 + lt, margin + corner_length);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GuiSetBorder::drawTopRightTrim(BorderState draw)
|
|
|
|
{
|
|
|
|
QColor col;
|
|
|
|
switch (draw) {
|
|
|
|
case LINE_SET:
|
|
|
|
col = Qt::black;
|
|
|
|
break;
|
|
|
|
case LINE_UNSET:
|
|
|
|
col = Qt::white;
|
|
|
|
break;
|
|
|
|
case LINE_UNDECIDED:
|
|
|
|
case LINE_UNDEF:
|
|
|
|
col = Qt::lightGray;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (!top_trim_right_.enabled)
|
|
|
|
col = QColor(Qt::white);
|
|
|
|
int const rt = corner_length;
|
|
|
|
if (top_trim_right_.enabled)
|
|
|
|
drawLine(col, bwidth - margin - corner_length - 1 - rt, margin + corner_length,
|
|
|
|
bwidth - margin - corner_length - 1, margin + corner_length);
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-07-24 13:49:27 +02:00
|
|
|
void GuiSetBorder::drawBottom(BorderState draw)
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2018-07-24 13:49:27 +02:00
|
|
|
QColor col;
|
|
|
|
switch (draw) {
|
|
|
|
case LINE_SET:
|
|
|
|
col = Qt::black;
|
2019-04-03 07:59:52 +02:00
|
|
|
bottom_drawn_wide_ = true;
|
2018-07-24 13:49:27 +02:00
|
|
|
break;
|
|
|
|
case LINE_UNSET:
|
|
|
|
col = Qt::white;
|
2019-04-03 07:59:52 +02:00
|
|
|
bottom_drawn_wide_ = false;
|
2018-07-24 13:49:27 +02:00
|
|
|
break;
|
|
|
|
case LINE_UNDECIDED:
|
|
|
|
case LINE_UNDEF:
|
|
|
|
col = Qt::lightGray;
|
2019-04-03 07:59:52 +02:00
|
|
|
bottom_drawn_wide_ = true;
|
2018-07-24 13:49:27 +02:00
|
|
|
break;
|
|
|
|
}
|
2006-03-05 17:24:44 +00:00
|
|
|
if (!bottom_.enabled)
|
2010-01-31 13:15:26 +00:00
|
|
|
col = QColor(Qt::lightGray);
|
2019-04-03 07:59:52 +02:00
|
|
|
int const lt = (bottom_trim_left_.enabled) ? corner_length + 4 : 0;
|
|
|
|
int const rt = (bottom_trim_right_.enabled) ? corner_length + 4 : 0;
|
|
|
|
drawLine(col, margin + corner_length + 2 + lt, bwidth - margin - corner_length + 1,
|
|
|
|
bwidth - margin - corner_length - 1 - rt, bwidth - margin - corner_length + 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-08-13 17:04:42 +02:00
|
|
|
void GuiSetBorder::undrawWideBottomLine(bool const right)
|
2019-04-03 07:59:52 +02:00
|
|
|
{
|
2019-08-13 17:04:42 +02:00
|
|
|
if (!bottom_drawn_wide_ && !right)
|
2019-04-03 07:59:52 +02:00
|
|
|
return;
|
|
|
|
|
2019-08-13 17:04:42 +02:00
|
|
|
// Overpaint previous lines white
|
|
|
|
if (right)
|
|
|
|
drawLine(Qt::white, margin + 2 * (corner_length + 2), bwidth - margin - corner_length + 1,
|
|
|
|
bwidth - margin - corner_length - 1, bwidth - margin - corner_length + 1);
|
|
|
|
else
|
|
|
|
drawLine(Qt::white, margin + corner_length + 2, bwidth - margin - corner_length + 1,
|
|
|
|
bwidth - margin - corner_length - 1, bwidth - margin - corner_length + 1);
|
2019-04-03 07:59:52 +02:00
|
|
|
bottom_drawn_wide_ = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GuiSetBorder::drawBottomLeftTrim(BorderState draw)
|
|
|
|
{
|
|
|
|
QColor col;
|
|
|
|
switch (draw) {
|
|
|
|
case LINE_SET:
|
|
|
|
col = Qt::black;
|
|
|
|
break;
|
|
|
|
case LINE_UNSET:
|
|
|
|
col = Qt::white;
|
|
|
|
break;
|
|
|
|
case LINE_UNDECIDED:
|
|
|
|
case LINE_UNDEF:
|
|
|
|
col = Qt::lightGray;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (!bottom_trim_left_.enabled)
|
|
|
|
col = QColor(Qt::white);
|
|
|
|
int const lt = corner_length;
|
|
|
|
if (bottom_trim_left_.enabled)
|
|
|
|
drawLine(col, margin + corner_length + 2, bwidth - margin - corner_length + 1,
|
|
|
|
margin + corner_length + 2 + lt, bwidth - margin - corner_length + 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GuiSetBorder::drawBottomRightTrim(BorderState draw)
|
|
|
|
{
|
|
|
|
QColor col;
|
|
|
|
switch (draw) {
|
|
|
|
case LINE_SET:
|
|
|
|
col = Qt::black;
|
|
|
|
break;
|
|
|
|
case LINE_UNSET:
|
|
|
|
col = Qt::white;
|
|
|
|
break;
|
|
|
|
case LINE_UNDECIDED:
|
|
|
|
case LINE_UNDEF:
|
|
|
|
col = Qt::lightGray;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (!bottom_trim_right_.enabled)
|
|
|
|
col = QColor(Qt::white);
|
|
|
|
int const rt = corner_length;
|
|
|
|
if (bottom_trim_right_.enabled)
|
|
|
|
drawLine(col, bwidth - margin - corner_length - 1 - rt, bwidth - margin - corner_length + 1,
|
|
|
|
bwidth - margin - corner_length - 1, bwidth - margin - corner_length + 1);
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-10-27 16:48:29 +01:00
|
|
|
void GuiSetBorder::setLeftEnabled(bool enabled)
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2015-10-27 16:48:29 +01:00
|
|
|
left_.enabled = enabled;
|
|
|
|
drawLeft(left_.set);
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-10-27 16:48:29 +01:00
|
|
|
void GuiSetBorder::setRightEnabled(bool enabled)
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2015-10-27 16:48:29 +01:00
|
|
|
right_.enabled = enabled;
|
|
|
|
drawRight(right_.set);
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-10-27 16:48:29 +01:00
|
|
|
void GuiSetBorder::setTopEnabled(bool enabled)
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2015-10-27 16:48:29 +01:00
|
|
|
top_.enabled = enabled;
|
|
|
|
drawTop(top_.set);
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-10-27 16:48:29 +01:00
|
|
|
void GuiSetBorder::setBottomEnabled(bool enabled)
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2015-10-27 16:48:29 +01:00
|
|
|
bottom_.enabled = enabled;
|
|
|
|
drawBottom(bottom_.set);
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-04-03 07:59:52 +02:00
|
|
|
void GuiSetBorder::setTopLeftTrimEnabled(bool enabled)
|
|
|
|
{
|
|
|
|
top_trim_left_.enabled = enabled;
|
|
|
|
undrawWideTopLine();
|
|
|
|
drawTopLeftTrim(top_trim_left_.set);
|
|
|
|
drawTop(top_.set);
|
|
|
|
top_drawn_wide_ = !enabled;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GuiSetBorder::setTopRightTrimEnabled(bool enabled)
|
|
|
|
{
|
|
|
|
top_trim_right_.enabled = enabled;
|
2019-08-13 17:04:42 +02:00
|
|
|
undrawWideTopLine(enabled);
|
2019-04-03 07:59:52 +02:00
|
|
|
drawTopRightTrim(top_trim_right_.set);
|
|
|
|
drawTop(top_.set);
|
2019-08-13 17:04:42 +02:00
|
|
|
top_drawn_wide_ = !enabled;
|
2019-04-03 07:59:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GuiSetBorder::setBottomLeftTrimEnabled(bool enabled)
|
|
|
|
{
|
|
|
|
bottom_trim_left_.enabled = enabled;
|
|
|
|
undrawWideBottomLine();
|
|
|
|
drawBottomLeftTrim(bottom_trim_left_.set);
|
|
|
|
drawBottom(bottom_.set);
|
2019-08-13 17:04:42 +02:00
|
|
|
bottom_drawn_wide_ = !enabled;
|
2019-04-03 07:59:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GuiSetBorder::setBottomRightTrimEnabled(bool enabled)
|
|
|
|
{
|
|
|
|
bottom_trim_right_.enabled = enabled;
|
2019-08-13 17:04:42 +02:00
|
|
|
undrawWideBottomLine(enabled);
|
2019-04-03 07:59:52 +02:00
|
|
|
drawBottomRightTrim(bottom_trim_right_.set);
|
|
|
|
drawBottom(bottom_.set);
|
2019-08-13 17:04:42 +02:00
|
|
|
bottom_drawn_wide_ = !enabled;
|
2019-04-03 07:59:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-07-24 13:49:27 +02:00
|
|
|
void GuiSetBorder::setLeft(BorderState border)
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
|
|
|
left_.set = border;
|
|
|
|
drawLeft(border);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-07-24 13:49:27 +02:00
|
|
|
void GuiSetBorder::setRight(BorderState border)
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
|
|
|
right_.set = border;
|
|
|
|
drawRight(border);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-07-24 13:49:27 +02:00
|
|
|
void GuiSetBorder::setTop(BorderState border)
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
|
|
|
top_.set = border;
|
|
|
|
drawTop(border);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-07-24 13:49:27 +02:00
|
|
|
void GuiSetBorder::setBottom(BorderState border)
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
|
|
|
bottom_.set = border;
|
|
|
|
drawBottom(border);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-04-03 07:59:52 +02:00
|
|
|
void GuiSetBorder::setTopLeftTrim(BorderState border)
|
|
|
|
{
|
|
|
|
top_trim_left_.set = border;
|
|
|
|
drawTopLeftTrim(border);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GuiSetBorder::setTopRightTrim(BorderState border)
|
|
|
|
{
|
|
|
|
top_trim_right_.set = border;
|
|
|
|
drawTopRightTrim(border);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GuiSetBorder::setBottomLeftTrim(BorderState border)
|
|
|
|
{
|
|
|
|
bottom_trim_left_.set = border;
|
|
|
|
drawBottomLeftTrim(border);
|
|
|
|
}
|
|
|
|
|
|
|
|
void GuiSetBorder::setBottomRightTrim(BorderState border)
|
|
|
|
{
|
|
|
|
bottom_trim_right_.set = border;
|
|
|
|
drawBottomRightTrim(border);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-07-24 13:49:27 +02:00
|
|
|
void GuiSetBorder::setAll(BorderState border)
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
|
|
|
setLeft(border);
|
|
|
|
setRight(border);
|
|
|
|
setTop(border);
|
|
|
|
setBottom(border);
|
2019-04-03 07:59:52 +02:00
|
|
|
setTopLeftTrim(border);
|
|
|
|
setTopRightTrim(border);
|
|
|
|
setBottomLeftTrim(border);
|
|
|
|
setBottomRightTrim(border);
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-07-24 13:49:27 +02:00
|
|
|
GuiSetBorder::BorderState GuiSetBorder::getLeft()
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
|
|
|
return left_.set;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-07-24 13:49:27 +02:00
|
|
|
GuiSetBorder::BorderState GuiSetBorder::getRight()
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
|
|
|
return right_.set;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-07-24 13:49:27 +02:00
|
|
|
GuiSetBorder::BorderState GuiSetBorder::getTop()
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
|
|
|
return top_.set;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-07-24 13:49:27 +02:00
|
|
|
GuiSetBorder::BorderState GuiSetBorder::getBottom()
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
|
|
|
return bottom_.set;
|
|
|
|
}
|
2006-05-18 08:51:12 +00:00
|
|
|
|
2019-04-03 07:59:52 +02:00
|
|
|
|
|
|
|
GuiSetBorder::BorderState GuiSetBorder::getTopLeftTrim()
|
|
|
|
{
|
|
|
|
return top_trim_left_.set;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
GuiSetBorder::BorderState GuiSetBorder::getTopRightTrim()
|
|
|
|
{
|
|
|
|
return top_trim_right_.set;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
GuiSetBorder::BorderState GuiSetBorder::getBottomLeftTrim()
|
|
|
|
{
|
|
|
|
return bottom_trim_left_.set;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
GuiSetBorder::BorderState GuiSetBorder::getBottomRightTrim()
|
|
|
|
{
|
|
|
|
return bottom_trim_right_.set;
|
|
|
|
}
|
|
|
|
|
2008-11-14 14:28:50 +00:00
|
|
|
#include "moc_GuiSetBorder.cpp"
|