Merge branch 'master' into apa-notification-on-live
This commit is contained in:
@@ -62,6 +62,18 @@ bool Button::getEnable() const
|
||||
return this->enabled_;
|
||||
}
|
||||
|
||||
void Button::setEnableMargin(bool value)
|
||||
{
|
||||
this->enableMargin_ = value;
|
||||
|
||||
this->update();
|
||||
}
|
||||
|
||||
bool Button::getEnableMargin() const
|
||||
{
|
||||
return this->enableMargin_;
|
||||
}
|
||||
|
||||
qreal Button::getCurrentDimAmount() const
|
||||
{
|
||||
return this->dimPixmap_ && !this->mouseOver_ ? 0.7 : 1;
|
||||
@@ -105,7 +117,7 @@ void Button::paintEvent(QPaintEvent *)
|
||||
}
|
||||
|
||||
QRect rect = this->rect();
|
||||
int s = int(6 * this->getScale());
|
||||
int s = this->enableMargin_ ? int(6 * this->getScale()) : 0;
|
||||
|
||||
rect.moveLeft(s);
|
||||
rect.setRight(rect.right() - s - s);
|
||||
|
||||
@@ -41,6 +41,9 @@ public:
|
||||
void setEnable(bool value);
|
||||
bool getEnable() const;
|
||||
|
||||
void setEnableMargin(bool value);
|
||||
bool getEnableMargin() const;
|
||||
|
||||
void setBorderColor(const QColor &color);
|
||||
const QColor &getBorderColor() const;
|
||||
|
||||
@@ -73,6 +76,7 @@ private:
|
||||
QColor borderColor_{};
|
||||
QPixmap pixmap_{};
|
||||
bool dimPixmap_{true};
|
||||
bool enableMargin_{true};
|
||||
QPoint mousePos_{};
|
||||
double hoverMultiplier_{0.0};
|
||||
QTimer effectTimer_{};
|
||||
|
||||
@@ -305,6 +305,7 @@ void ChannelView::clearMessages()
|
||||
{
|
||||
// Clear all stored messages in this chat widget
|
||||
this->messages.clear();
|
||||
this->scrollBar_->clearHighlights();
|
||||
|
||||
// Layout chat widget messages, and force an update regardless if there are
|
||||
// no messages
|
||||
@@ -870,11 +871,15 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event)
|
||||
return;
|
||||
}
|
||||
const auto &tooltip = hoverLayoutElement->getCreator().getTooltip();
|
||||
bool isLinkValid = hoverLayoutElement->getLink().isValid();
|
||||
|
||||
if (tooltip.isEmpty()) {
|
||||
tooltipWidget->hide();
|
||||
} else if (isLinkValid && !getSettings()->enableLinkInfoTooltip) {
|
||||
tooltipWidget->hide();
|
||||
} else {
|
||||
tooltipWidget->moveTo(this, event->globalPos());
|
||||
tooltipWidget->setWordWrap(isLinkValid);
|
||||
tooltipWidget->setText(tooltip);
|
||||
tooltipWidget->adjustSize();
|
||||
tooltipWidget->show();
|
||||
@@ -882,7 +887,7 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event)
|
||||
}
|
||||
|
||||
// check if word has a link
|
||||
if (hoverLayoutElement->getLink().isValid()) {
|
||||
if (isLinkValid) {
|
||||
this->setCursor(Qt::PointingHandCursor);
|
||||
} else {
|
||||
this->setCursor(Qt::ArrowCursor);
|
||||
|
||||
@@ -313,6 +313,8 @@ void NotebookTab::paintEvent(QPaintEvent *)
|
||||
if (this->shouldDrawXButton()) {
|
||||
QRect xRect = this->getXRect();
|
||||
if (!xRect.isNull()) {
|
||||
if (this->selected_) xRect.moveTop(xRect.top() - 1);
|
||||
|
||||
painter.setBrush(QColor("#fff"));
|
||||
|
||||
if (this->mouseOverX_) {
|
||||
@@ -474,7 +476,7 @@ QRect NotebookTab::getXRect()
|
||||
|
||||
float s = this->getScale();
|
||||
return QRect(this->width() - static_cast<int>(20 * s),
|
||||
static_cast<int>(6 * s), static_cast<int>(16 * s),
|
||||
static_cast<int>(9 * s), static_cast<int>(16 * s),
|
||||
static_cast<int>(16 * s));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user