Feat: (Linux) Themes allow transparency on chat windows background (#6137)
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
- Minor: Add an option for the reduced opacity of message history. (#6121)
|
- Minor: Add an option for the reduced opacity of message history. (#6121)
|
||||||
- Minor: Make paused chat indicator more visible, and fix its zoom behavior. (#6123)
|
- Minor: Make paused chat indicator more visible, and fix its zoom behavior. (#6123)
|
||||||
- Minor: Added WebSocket API for plugins. (#6076)
|
- Minor: Added WebSocket API for plugins. (#6076)
|
||||||
|
- Minor: Allow for themes to set transparent values for window background on Linux. (#6137)
|
||||||
- Minor: Popup overlay now only draws an outline when being interacted with. (#6140)
|
- Minor: Popup overlay now only draws an outline when being interacted with. (#6140)
|
||||||
- Bugfix: Don't create native messaging manifest file if browser directory doesn't exist. (#6116)
|
- Bugfix: Don't create native messaging manifest file if browser directory doesn't exist. (#6116)
|
||||||
- Bugfix: Fixed scrolling now working on inputs in the settings. (#6128)
|
- Bugfix: Fixed scrolling now working on inputs in the settings. (#6128)
|
||||||
|
|||||||
@@ -75,6 +75,12 @@ Window::Window(WindowType type, QWidget *parent)
|
|||||||
if (type == WindowType::Main)
|
if (type == WindowType::Main)
|
||||||
{
|
{
|
||||||
this->resize(int(600 * this->scale()), int(500 * this->scale()));
|
this->resize(int(600 * this->scale()), int(500 * this->scale()));
|
||||||
|
#ifdef Q_OS_LINUX
|
||||||
|
if (this->theme->window.background.alpha() != 255)
|
||||||
|
{
|
||||||
|
this->setAttribute(Qt::WA_TranslucentBackground);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
#include <QMimeData>
|
#include <QMimeData>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
#include <QPainterPath>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
@@ -613,6 +614,29 @@ void SplitContainer::mouseReleaseEvent(QMouseEvent *event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SplitContainer::paintSplitBorder(Node *node, QPainter *painter)
|
||||||
|
{
|
||||||
|
switch (node->type_)
|
||||||
|
{
|
||||||
|
case Node::Type::Split: {
|
||||||
|
QRectF nodeRect = node->geometry_;
|
||||||
|
painter->setPen(this->theme->tabs.dividerLine);
|
||||||
|
QPainterPath p = QPainterPath();
|
||||||
|
p.addRect(nodeRect);
|
||||||
|
painter->strokePath(p, painter->pen());
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Node::Type::VerticalContainer:
|
||||||
|
case Node::Type::HorizontalContainer: {
|
||||||
|
for (std::unique_ptr<Node> &child : node->children_)
|
||||||
|
{
|
||||||
|
paintSplitBorder(child.get(), painter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void SplitContainer::paintEvent(QPaintEvent * /*event*/)
|
void SplitContainer::paintEvent(QPaintEvent * /*event*/)
|
||||||
{
|
{
|
||||||
QPainter painter(this);
|
QPainter painter(this);
|
||||||
@@ -643,14 +667,7 @@ void SplitContainer::paintEvent(QPaintEvent * /*event*/)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (getApp()->getThemes()->isLightTheme())
|
this->paintSplitBorder(this->getBaseNode(), &painter);
|
||||||
{
|
|
||||||
painter.fillRect(rect(), QColor("#999"));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
painter.fillRect(rect(), QColor("#555"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (DropRect &dropRect : this->dropRects_)
|
for (DropRect &dropRect : this->dropRects_)
|
||||||
|
|||||||
@@ -246,6 +246,7 @@ private:
|
|||||||
void selectSplitRecursive(Node *node, SplitDirection direction);
|
void selectSplitRecursive(Node *node, SplitDirection direction);
|
||||||
void focusSplitRecursive(Node *node);
|
void focusSplitRecursive(Node *node);
|
||||||
void setPreferedTargetRecursive(Node *node);
|
void setPreferedTargetRecursive(Node *node);
|
||||||
|
void paintSplitBorder(Node *node, QPainter *painter);
|
||||||
|
|
||||||
void addSplit(Split *split);
|
void addSplit(Split *split);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user