plyght's own C++ browser for macOS
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fixes

plyght 3dda78db edf8ce14

+31 -11
+15 -10
src/app/BrowserWindow.cpp
··· 123 123 mac::roundWidgetCorners(m_webContainer, ui::metrics::WebContainerRadius, /*recurseDescendants=*/false); 124 124 } 125 125 if (m_stack) mac::roundWidgetCorners(m_stack, 0.0); 126 - if (auto *host = findChild<QWidget *>("StackHost")) { 127 - mac::applyVibrancyBehind(host, mac::VibrancyMaterial::Sidebar); 128 - } 129 126 }); 130 127 } 131 128 ··· 283 280 connect(m_addressBar, &QLineEdit::textChanged, this, [syncSearchIcon](const QString &) { syncSearchIcon(); }); 284 281 285 282 if (auto *pill = qobject_cast<ui::AddrPill *>(m_addrWrap)) { 286 - pill->setIdleColor(QColor(255, 255, 255, 14)); 283 + pill->setIdleColor(QColor(28, 28, 30, 235)); 287 284 } 288 285 // Pop the pill when the user begins editing it. 289 286 class FocusPopFilter : public QObject { ··· 445 442 // pushing the page content down. 446 443 m_webContainer = new QWidget(stackHost); 447 444 m_webContainer->setObjectName("WebContainer"); 448 - m_webContainer->setStyleSheet( 449 - "QWidget#WebContainer { background: #1a1a1a; }"); 445 + m_webContainer->setStyleSheet(QString( 446 + "QWidget#WebContainer { background: rgba(26, 26, 26, 180); border-radius: %1px; }") 447 + .arg(ui::metrics::WebContainerRadius)); 450 448 auto *containerLayout = new QVBoxLayout(m_webContainer); 451 449 containerLayout->setContentsMargins(0, 0, 0, 0); 452 450 containerLayout->setSpacing(0); ··· 860 858 861 859 // Hover shade: lighten dark pages, darken light ones — same logic for 862 860 // toolbar buttons and the address bar wrap. 863 - QColor hover = bg; 864 - hover = dark ? hover.lighter(125) : hover.darker(108); 861 + auto mixRgb = [](const QColor &from, const QColor &to, double t) { 862 + return QColor(qRound(from.red() + (to.red() - from.red()) * t), 863 + qRound(from.green() + (to.green() - from.green()) * t), 864 + qRound(from.blue() + (to.blue() - from.blue()) * t), 865 + from.alpha()); 866 + }; 867 + QColor hover = dark ? mixRgb(bg, QColor(255, 255, 255, bg.alpha()), 0.16) 868 + : mixRgb(bg, QColor(0, 0, 0, bg.alpha()), 0.10); 865 869 hover.setAlpha(qMax(220, bg.alpha())); 866 870 867 - QColor pressed = bg; 868 - pressed = dark ? pressed.lighter(140) : pressed.darker(115); 871 + QColor pressed = dark ? mixRgb(bg, QColor(255, 255, 255, bg.alpha()), 0.24) 872 + : mixRgb(bg, QColor(0, 0, 0, bg.alpha()), 0.16); 869 873 pressed.setAlpha(qMax(230, bg.alpha())); 870 874 871 875 auto rgba = [](const QColor &c) { ··· 906 910 } 907 911 908 912 if (auto *pill = qobject_cast<ui::AddrPill *>(m_addrWrap)) { 913 + pill->setIdleColor(bg); 909 914 pill->setHoverColor(hover); 910 915 QColor loadTint = fg; 911 916 loadTint.setAlpha(220);
+12 -1
src/ui/ChromeWidgets.cpp
··· 50 50 51 51 void ChromeBar::paintEvent(QPaintEvent *) { 52 52 QPainter p(this); 53 - p.fillRect(rect(), m_bg); 53 + p.setRenderHint(QPainter::Antialiasing, true); 54 + if (m_topCornerRadius <= 0) { 55 + p.fillRect(rect(), m_bg); 56 + return; 57 + } 58 + 59 + QPainterPath path; 60 + path.setFillRule(Qt::WindingFill); 61 + const QRectF r(rect()); 62 + path.addRoundedRect(r, m_topCornerRadius, m_topCornerRadius); 63 + path.addRect(QRectF(r.left(), r.top() + m_topCornerRadius, r.width(), r.height() - m_topCornerRadius)); 64 + p.fillPath(path, m_bg); 54 65 } 55 66 56 67 // ---- AddrPill -----------------------------------------------------------
+2
src/ui/ChromeWidgets.hpp
··· 17 17 18 18 void setBackgroundColor(const QColor &c, bool animate = true); 19 19 QColor backgroundColor() const { return m_bg; } 20 + void setTopCornerRadius(int px) { m_topCornerRadius = px; update(); } 20 21 21 22 protected: 22 23 void paintEvent(QPaintEvent *) override; 23 24 24 25 private: 25 26 QColor m_bg; 27 + int m_topCornerRadius = 0; 26 28 QVariantAnimation *m_anim = nullptr; 27 29 }; 28 30
+2
src/ui/Topbar.cpp
··· 1 1 #include "Topbar.hpp" 2 2 3 3 #include "ChromeWidgets.hpp" 4 + #include "LayoutMetrics.hpp" 4 5 #include "MacIntegration.hpp" 5 6 6 7 #include <QHBoxLayout> ··· 19 20 auto *bar = new ChromeBar(parent); 20 21 bar->setObjectName("WebTopbar"); 21 22 bar->setFixedHeight(40); 23 + bar->setTopCornerRadius(ui::metrics::WebContainerRadius); 22 24 bar->setBackgroundColor(QColor(28, 28, 30, 235), /*animate=*/false); 23 25 w.bar = bar; 24 26