mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
reformat
This commit is contained in:
parent
b2d88ba555
commit
0e1f1196d6
5 changed files with 17 additions and 29 deletions
|
@ -133,8 +133,7 @@ Irc::Irc()
|
|||
|
||||
if (args.caller != Irc::noEraseCredentialCaller)
|
||||
{
|
||||
Credentials::instance().erase("irc",
|
||||
getCredentialName(args.item));
|
||||
Credentials::instance().erase("irc", getCredentialName(args.item));
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -649,8 +649,8 @@ IndirectChannel WindowManager::decodeChannel(const QJsonObject &obj)
|
|||
}
|
||||
else if (type == "irc")
|
||||
{
|
||||
return Irc::instance().getOrAddChannel(
|
||||
obj.value("server").toInt(-1), obj.value("channel").toString());
|
||||
return Irc::instance().getOrAddChannel(obj.value("server").toInt(-1),
|
||||
obj.value("channel").toString());
|
||||
}
|
||||
|
||||
return Channel::getEmpty();
|
||||
|
|
|
@ -340,20 +340,17 @@ void BaseWindow::onFocusLost()
|
|||
{
|
||||
switch (this->getActionOnFocusLoss())
|
||||
{
|
||||
case Delete:
|
||||
{
|
||||
case Delete: {
|
||||
this->deleteLater();
|
||||
}
|
||||
break;
|
||||
|
||||
case Close:
|
||||
{
|
||||
case Close: {
|
||||
this->close();
|
||||
}
|
||||
break;
|
||||
|
||||
case Hide:
|
||||
{
|
||||
case Hide: {
|
||||
this->hide();
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -133,8 +133,8 @@ SelectChannelDialog::SelectChannelDialog(QWidget *parent)
|
|||
auto outerBox = obj.setLayoutType<QFormLayout>();
|
||||
|
||||
{
|
||||
auto view = this->ui_.irc.servers = new EditableModelView(
|
||||
Irc::instance().newConnectionModel(this));
|
||||
auto view = this->ui_.irc.servers =
|
||||
new EditableModelView(Irc::instance().newConnectionModel(this));
|
||||
|
||||
view->setTitles({"host", "port", "ssl", "user", "nick", "real",
|
||||
"password", "login command"});
|
||||
|
@ -166,8 +166,7 @@ SelectChannelDialog::SelectChannelDialog(QWidget *parent)
|
|||
if (editor->exec() == QDialog::Accepted)
|
||||
{
|
||||
auto data = editor->data();
|
||||
auto &&conns =
|
||||
Irc::instance().connections.getVector();
|
||||
auto &&conns = Irc::instance().connections.getVector();
|
||||
int i = 0;
|
||||
for (auto &&conn : conns)
|
||||
{
|
||||
|
@ -175,8 +174,7 @@ SelectChannelDialog::SelectChannelDialog(QWidget *parent)
|
|||
{
|
||||
Irc::instance().connections.removeItem(
|
||||
i, Irc::noEraseCredentialCaller);
|
||||
Irc::instance().connections.insertItem(data,
|
||||
i);
|
||||
Irc::instance().connections.insertItem(data, i);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
|
|
@ -36,19 +36,16 @@ void TitleBarButton::paintEvent(QPaintEvent *event)
|
|||
|
||||
switch (this->style_)
|
||||
{
|
||||
case TitleBarButtonStyle::Minimize:
|
||||
{
|
||||
case TitleBarButtonStyle::Minimize: {
|
||||
painter.fillRect(centerX - xD / 2, xD * 3 / 2, xD, 1, color);
|
||||
break;
|
||||
}
|
||||
case TitleBarButtonStyle::Maximize:
|
||||
{
|
||||
case TitleBarButtonStyle::Maximize: {
|
||||
painter.setPen(color);
|
||||
painter.drawRect(centerX - xD / 2, xD, xD - 1, xD - 1);
|
||||
break;
|
||||
}
|
||||
case TitleBarButtonStyle::Unmaximize:
|
||||
{
|
||||
case TitleBarButtonStyle::Unmaximize: {
|
||||
int xD2 = xD * 1 / 5;
|
||||
int xD3 = xD * 4 / 5;
|
||||
|
||||
|
@ -58,8 +55,7 @@ void TitleBarButton::paintEvent(QPaintEvent *event)
|
|||
painter.drawRect(centerX - xD / 2, xD + xD2, xD3, xD3);
|
||||
break;
|
||||
}
|
||||
case TitleBarButtonStyle::Close:
|
||||
{
|
||||
case TitleBarButtonStyle::Close: {
|
||||
QRect rect(centerX - xD / 2, xD, xD - 1, xD - 1);
|
||||
painter.setPen(QPen(color, 1));
|
||||
|
||||
|
@ -67,8 +63,7 @@ void TitleBarButton::paintEvent(QPaintEvent *event)
|
|||
painter.drawLine(rect.topRight(), rect.bottomLeft());
|
||||
break;
|
||||
}
|
||||
case TitleBarButtonStyle::User:
|
||||
{
|
||||
case TitleBarButtonStyle::User: {
|
||||
color = "#999";
|
||||
|
||||
painter.setRenderHint(QPainter::Antialiasing);
|
||||
|
@ -94,8 +89,7 @@ void TitleBarButton::paintEvent(QPaintEvent *event)
|
|||
|
||||
break;
|
||||
}
|
||||
case TitleBarButtonStyle::Settings:
|
||||
{
|
||||
case TitleBarButtonStyle::Settings: {
|
||||
color = "#999";
|
||||
painter.setRenderHint(QPainter::Antialiasing);
|
||||
painter.setRenderHint(QPainter::HighQualityAntialiasing);
|
||||
|
|
Loading…
Reference in a new issue