mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
fixed rectangle being off by 1 pixel in split container
This commit is contained in:
parent
5957b87298
commit
bdfe24035b
3 changed files with 14 additions and 11 deletions
|
@ -140,7 +140,7 @@ ImagePtr Image::fromUrl(const Url &url, qreal scale)
|
|||
if (!shared) {
|
||||
cache[url] = shared = ImagePtr(new Image(url, scale));
|
||||
} else {
|
||||
Warn("same image loaded multiple times: {}", url.string);
|
||||
// Warn("same image loaded multiple times: {}", url.string);
|
||||
}
|
||||
|
||||
return shared;
|
||||
|
|
|
@ -31,8 +31,7 @@ TwitchMessageBuilder::TwitchMessageBuilder(
|
|||
, originalMessage_(_ircMessage->content())
|
||||
, action_(_ircMessage->isAction())
|
||||
{
|
||||
auto app = getApp();
|
||||
this->usernameColor_ = app->themes->messages.textColors.system;
|
||||
this->usernameColor_ = getApp()->themes->messages.textColors.system;
|
||||
}
|
||||
|
||||
TwitchMessageBuilder::TwitchMessageBuilder(
|
||||
|
@ -46,8 +45,7 @@ TwitchMessageBuilder::TwitchMessageBuilder(
|
|||
, originalMessage_(content)
|
||||
, action_(isAction)
|
||||
{
|
||||
auto app = getApp();
|
||||
this->usernameColor_ = app->themes->messages.textColors.system;
|
||||
this->usernameColor_ = getApp()->themes->messages.textColors.system;
|
||||
}
|
||||
|
||||
bool TwitchMessageBuilder::isIgnored() const
|
||||
|
|
|
@ -326,25 +326,30 @@ void SplitContainer::layout()
|
|||
|
||||
Node *node = this->baseNode_.findNodeContainingSplit(split);
|
||||
|
||||
// left
|
||||
_dropRects.push_back(
|
||||
DropRect(QRect(g.left(), g.top(), g.width() / 3, g.height()),
|
||||
Position(node, Direction::Left)));
|
||||
_dropRects.push_back(DropRect(QRect(g.left() + g.width() / 3 * 2,
|
||||
g.top(), g.width() / 3, g.height()),
|
||||
// right
|
||||
_dropRects.push_back(DropRect(QRect(g.right() - g.width() / 3, g.top(),
|
||||
g.width() / 3, g.height()),
|
||||
Position(node, Direction::Right)));
|
||||
|
||||
// top
|
||||
_dropRects.push_back(
|
||||
DropRect(QRect(g.left(), g.top(), g.width(), g.height() / 2),
|
||||
Position(node, Direction::Above)));
|
||||
_dropRects.push_back(DropRect(QRect(g.left(), g.top() + g.height() / 2,
|
||||
g.width(), g.height() / 2),
|
||||
Position(node, Direction::Below)));
|
||||
// bottom
|
||||
_dropRects.push_back(
|
||||
DropRect(QRect(g.left(), g.bottom() - g.height() / 2, g.width(),
|
||||
g.height() / 2),
|
||||
Position(node, Direction::Below)));
|
||||
}
|
||||
|
||||
if (this->splits_.empty()) {
|
||||
QRect g = this->rect();
|
||||
_dropRects.push_back(
|
||||
DropRect(QRect(g.left(), g.top(), g.width(), g.height()),
|
||||
DropRect(QRect(g.left(), g.top(), g.width() - 1, g.height() - 1),
|
||||
Position(nullptr, Direction::Below)));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue