Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add transparent overlay window #4746

Merged
merged 71 commits into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
266d61a
feat: add transparent overlay window
Nerixyz Aug 2, 2023
6534c5e
chore: add changelog entry
Nerixyz Aug 2, 2023
9b45a7c
fix: yea but painter
Nerixyz Aug 2, 2023
0685e38
fix: PCH thingy
Nerixyz Aug 2, 2023
32dbdcc
fix: use indirect channel
Nerixyz Aug 3, 2023
665b376
fix: use weak references to splits
Nerixyz Aug 3, 2023
e7fbe18
chore: add changelog entry
Nerixyz Aug 3, 2023
4d63b7f
fix: qt5
Nerixyz Aug 3, 2023
8dd5971
fix: no idea why clangd/-format does this
Nerixyz Aug 3, 2023
37c6054
fix: include split
Nerixyz Aug 16, 2023
80707ab
feat: add drop shadow
Nerixyz Aug 16, 2023
200d1c2
feat: add setting for shadow
Nerixyz Aug 16, 2023
256c1aa
fix: improve ui when holding shift
Nerixyz Aug 16, 2023
536aff0
feat: add global shortcuts
Nerixyz Aug 24, 2023
0d3b16f
feat: add shortcut for inert mode
Nerixyz Aug 24, 2023
cc599a1
refactor: improve global shortcuts
Nerixyz Aug 25, 2023
79c81fc
refactor: indicate unlocked window
Nerixyz Aug 25, 2023
0d0ea81
fix: start interaction when moving
Nerixyz Aug 25, 2023
2ff69d4
fix: debug log
Nerixyz Aug 25, 2023
50dd9af
Merge remote-tracking branch 'upstream/master' into feat/transparent-…
Nerixyz Aug 27, 2023
9b54769
fix: duplicate include
Nerixyz Aug 27, 2023
09ebc49
feat: add welcome message
Nerixyz Aug 27, 2023
f44252d
fix: use the awesome byte array literal suffix
Nerixyz Aug 27, 2023
76b4e76
fix: set a title
Nerixyz Aug 27, 2023
fa8e9b3
fix: mention toggle
Nerixyz Aug 27, 2023
facddf3
Merge remote-tracking branch 'upstream/master' into feat/transparent-…
Nerixyz Dec 17, 2023
a5ce8ff
fix: bad merge
Nerixyz Dec 17, 2023
4ef0992
fix: json schema
Nerixyz Dec 17, 2023
3aad361
fix: cmake formatting
Nerixyz Dec 17, 2023
ff99d9a
fix: formatting
Nerixyz Dec 17, 2023
a152476
fix: no base
Nerixyz Dec 17, 2023
35038db
fix: overlaywindow
Nerixyz Dec 17, 2023
c6e374f
fix: stuff
Nerixyz Dec 17, 2023
e63fcf1
fix: more cursor and theme stuff
Nerixyz Dec 18, 2023
9a5cc34
fix: old compiler stuff
Nerixyz Dec 18, 2023
2d1947d
fix: old qt
Nerixyz Dec 18, 2023
df2d66d
fix: more stuff
Nerixyz Dec 18, 2023
d684780
refactor: native shortcuts
Nerixyz Dec 18, 2023
9406d45
Merge remote-tracking branch 'upstream/master' into feat/transparent-…
Nerixyz Mar 26, 2024
6b34b29
refactor: add more settings
Nerixyz Mar 26, 2024
2835fc3
fix: more update()
Nerixyz Mar 26, 2024
3cf61a6
feat: hide scrollbar in inertia
Nerixyz Mar 26, 2024
2781870
chore: more shortcut docs
Nerixyz Mar 26, 2024
ed3b0f5
fix: hide `inert`
Nerixyz Mar 26, 2024
41816a3
fix: hide inert2
Nerixyz Mar 26, 2024
f3d4e93
Merge remote-tracking branch 'upstream/master' into feat/transparent-…
Nerixyz Jul 3, 2024
efb3a4d
Merge remote-tracking branch 'upstream/master' into feat/transparent-…
Nerixyz Sep 7, 2024
ee8dec4
feat: more stuff and I think it works good enough for me
Nerixyz Sep 8, 2024
70b0c19
Merge remote-tracking branch 'upstream/master' into feat/transparent-…
Nerixyz Sep 8, 2024
9e72c0c
fix: changelog
Nerixyz Sep 8, 2024
3e86071
fix: formatting
Nerixyz Sep 8, 2024
5135366
fix: use NativeResult
Nerixyz Sep 8, 2024
7273463
fix: aaaaaaaaaaaaaaaaaaaaaa
Nerixyz Sep 8, 2024
bc5fbdd
fix: global -> local shortcut
Nerixyz Sep 8, 2024
50a9bc4
Merge remote-tracking branch 'upstream/master' into feat/transparent-…
Nerixyz Sep 8, 2024
db8e18b
fix: size-grip
Nerixyz Sep 8, 2024
0e298a0
fix: random stuff i noticed
Nerixyz Sep 8, 2024
f2e5a56
fix: qt5
Nerixyz Sep 8, 2024
682a87a
fix: qt5 again
Nerixyz Sep 8, 2024
2422c69
fix: all by default and all-or-nothing shortcut
Nerixyz Sep 29, 2024
eb4c846
refactor: no more visitor
Nerixyz Sep 29, 2024
c829dcb
refactor: specify shadow color in settings
Nerixyz Sep 29, 2024
c271272
chore: remove unused overlay theme keys
Nerixyz Sep 30, 2024
28a6ccc
Merge remote-tracking branch 'upstream/master' into feat/transparent-…
Nerixyz Sep 30, 2024
4617a6e
Revert "chore: remove unused overlay theme keys"
Nerixyz Sep 30, 2024
75e3dbf
feat: use colors from theme for text in overlay
Nerixyz Sep 30, 2024
8f2bbdd
fix: remove unused theme
Nerixyz Sep 30, 2024
3062463
fix: tests
Nerixyz Sep 30, 2024
cd72595
fix: `update` after `overlayBackgroundOpacity` changes
Nerixyz Oct 6, 2024
3306ac8
Merge remote-tracking branch 'upstream/master' into feat/transparent-…
Nerixyz Oct 6, 2024
f0cbdde
refactor: `togglePopupInertia` -> `toggleOverlayInertia`
Nerixyz Oct 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Major: Add option to show pronouns in user card. (#5442, #5583)
- Major: Release plugins alpha. (#5288)
- Major: Improve high-DPI support on Windows. (#4868, #5391)
- Major: Added transparent overlay window (default keybind: <kbd>CTRL</kbd> + <kbd>ALT</kbd> + <kbd>N</kbd>). (#4746)
- Minor: Removed the Ctrl+Shift+L hotkey for toggling the "live only" tab visibility state. (#5530)
- Minor: Add support for Shared Chat messages. Shared chat messages can be filtered with the `flags.shared` filter variable, or with search using `is:shared`. Some messages like subscriptions are filtered on purpose to avoid confusion for the broadcaster. If you have both channels participating in Shared Chat open, only one of the message triggering your highlight will trigger. (#5606, #5625)
- Minor: Moved tab visibility control to a submenu, without any toggle actions. (#5530)
Expand Down
92 changes: 65 additions & 27 deletions docs/ChatterinoTheme.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,47 @@
"text": { "$ref": "#/definitions/qt-color" }
},
"required": ["backgrounds", "line", "text"]
},
"text-colors": {
"type": "object",
"additionalProperties": false,
"properties": {
"caret": { "$ref": "#/definitions/qt-color" },
"chatPlaceholder": { "$ref": "#/definitions/qt-color" },
"link": { "$ref": "#/definitions/qt-color" },
"regular": { "$ref": "#/definitions/qt-color" },
"system": { "$ref": "#/definitions/qt-color" }
},
"required": ["caret", "chatPlaceholder", "link", "regular", "system"]
},
"message-backgrounds": {
"type": "object",
"additionalProperties": false,
"properties": {
"alternate": { "$ref": "#/definitions/qt-color" },
"regular": { "$ref": "#/definitions/qt-color" }
},
"required": ["alternate", "regular"]
},
"message-colors": {
"type": "object",
"additionalProperties": false,
"properties": {
"backgrounds": { "$ref": "#/definitions/message-backgrounds" },
"disabled": { "$ref": "#/definitions/qt-color" },
"highlightAnimationEnd": { "$ref": "#/definitions/qt-color" },
"highlightAnimationStart": { "$ref": "#/definitions/qt-color" },
"selection": { "$ref": "#/definitions/qt-color" },
"textColors": { "$ref": "#/definitions/text-colors" }
},
"required": [
"backgrounds",
"disabled",
"highlightAnimationEnd",
"highlightAnimationStart",
"selection",
"textColors"
]
}
},
"type": "object",
Expand All @@ -229,37 +270,12 @@
"type": "object",
"additionalProperties": false,
"properties": {
"backgrounds": {
"type": "object",
"additionalProperties": false,
"properties": {
"alternate": { "$ref": "#/definitions/qt-color" },
"regular": { "$ref": "#/definitions/qt-color" }
},
"required": ["alternate", "regular"]
},
"backgrounds": { "$ref": "#/definitions/message-backgrounds" },
"disabled": { "$ref": "#/definitions/qt-color" },
"highlightAnimationEnd": { "$ref": "#/definitions/qt-color" },
"highlightAnimationStart": { "$ref": "#/definitions/qt-color" },
"selection": { "$ref": "#/definitions/qt-color" },
"textColors": {
"type": "object",
"additionalProperties": false,
"properties": {
"caret": { "$ref": "#/definitions/qt-color" },
"chatPlaceholder": { "$ref": "#/definitions/qt-color" },
"link": { "$ref": "#/definitions/qt-color" },
"regular": { "$ref": "#/definitions/qt-color" },
"system": { "$ref": "#/definitions/qt-color" }
},
"required": [
"caret",
"chatPlaceholder",
"link",
"regular",
"system"
]
}
"textColors": { "$ref": "#/definitions/text-colors" }
},
"required": [
"backgrounds",
Expand All @@ -270,6 +286,27 @@
"textColors"
]
},
"overlayMessages": {
"type": "object",
"additionalProperties": false,
"properties": {
"backgrounds": { "$ref": "#/definitions/message-backgrounds" },
"disabled": { "$ref": "#/definitions/qt-color" },
"selection": { "$ref": "#/definitions/qt-color" },
"textColors": { "$ref": "#/definitions/text-colors" },
"background": {
"$ref": "#/definitions/qt-color",
"description": "Note: The alpha value is ignored (set through the settings)"
}
},
"required": [
"backgrounds",
"disabled",
"selection",
"textColors",
"background"
]
},
"scrollbars": {
"type": "object",
"additionalProperties": false,
Expand Down Expand Up @@ -376,6 +413,7 @@
"required": [
"accent",
"messages",
"overlayMessages",
"scrollbars",
"splits",
"tabs",
Expand Down
16 changes: 16 additions & 0 deletions resources/themes/Black.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,22 @@
"system": "#8c7f7f"
}
},
"overlayMessages": {
"backgrounds": {
"alternate": "#32000000",
"regular": "transparent"
},
"disabled": "#64000000",
"selection": "#40ffffff",
"textColors": {
"caret": "#ffffff",
"chatPlaceholder": "#5d5555",
"link": "#4286f4",
"regular": "#ffffff",
"system": "#8c7f7f"
},
"background": "#000"
},
"scrollbars": {
"background": "#00000000",
"thumb": "#4d4d4d",
Expand Down
16 changes: 16 additions & 0 deletions resources/themes/Dark.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,22 @@
"system": "#8c7f7f"
}
},
"overlayMessages": {
"backgrounds": {
"alternate": "#32000000",
"regular": "transparent"
},
"disabled": "#64000000",
"selection": "#40ffffff",
"textColors": {
"caret": "#ffffff",
"chatPlaceholder": "#5d5555",
"link": "#4286f4",
"regular": "#ffffff",
"system": "#8c7f7f"
},
"background": "#000"
},
"scrollbars": {
"background": "#00000000",
"thumb": "#575757",
Expand Down
16 changes: 16 additions & 0 deletions resources/themes/Light.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,22 @@
"system": "#8c7f7f"
}
},
"overlayMessages": {
"backgrounds": {
"alternate": "#32000000",
"regular": "transparent"
},
"disabled": "#64000000",
"selection": "#40ffffff",
"textColors": {
"caret": "#ffffff",
"chatPlaceholder": "#5d5555",
"link": "#4286f4",
"regular": "#ffffff",
"system": "#8c7f7f"
},
"background": "#333"
},
"scrollbars": {
"background": "#00000000",
"thumb": "#a8a8a8",
Expand Down
16 changes: 16 additions & 0 deletions resources/themes/White.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,22 @@
"system": "#8c7f7f"
}
},
"overlayMessages": {
"backgrounds": {
"alternate": "#32000000",
"regular": "transparent"
},
"disabled": "#64000000",
"selection": "#40ffffff",
"textColors": {
"caret": "#ffffff",
"chatPlaceholder": "#5d5555",
"link": "#4286f4",
"regular": "#ffffff",
"system": "#8c7f7f"
},
"background": "#333"
},
"scrollbars": {
"background": "#00000000",
"thumb": "#b3b3b3",
Expand Down
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,8 @@ set(SOURCE_FILES
widgets/Label.hpp
widgets/Notebook.cpp
widgets/Notebook.hpp
widgets/OverlayWindow.cpp
widgets/OverlayWindow.hpp
widgets/Scrollbar.cpp
widgets/Scrollbar.hpp
widgets/TooltipEntryWidget.cpp
Expand Down Expand Up @@ -638,6 +640,8 @@ set(SOURCE_FILES
widgets/helper/NotebookButton.hpp
widgets/helper/NotebookTab.cpp
widgets/helper/NotebookTab.hpp
widgets/helper/OverlayInteraction.cpp
widgets/helper/OverlayInteraction.hpp
widgets/helper/RegExpItemDelegate.cpp
widgets/helper/RegExpItemDelegate.hpp
widgets/helper/ResizingTextEdit.cpp
Expand Down
17 changes: 16 additions & 1 deletion src/controllers/hotkeys/ActionNames.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,20 @@ inline const std::map<HotkeyCategory, ActionDefinitionMap> actionNames{
{"showSearch", ActionDefinition{"Search current channel"}},
{"showGlobalSearch", ActionDefinition{"Search all channels"}},
{"debug", ActionDefinition{"Show debug popup"}},
{"popupOverlay", ActionDefinition{"New overlay popup"}},
{"toggleOverlayInertia",
ActionDefinition{
.displayName = "Toggle overlay click-through",
.argumentDescription = "<target popup: this or thisOrAll or all>",
.minCountArguments = 1,
.maxCountArguments = 1,
.possibleArguments{
{"This", {"this"}},
{"All", {"all"}},
{"This or all", {"thisOrAll"}},
},
.argumentsPrompt = "Target popup:",
}},
}},
{HotkeyCategory::SplitInput,
{
Expand Down Expand Up @@ -259,7 +273,8 @@ inline const std::map<HotkeyCategory, ActionDefinitionMap> actionNames{
{"moveTab",
ActionDefinition{
"Move tab",
"<where to move the tab: next, previous, or new index of tab>",
"<where to move the tab: next, previous, or new index of "
"tab>",
1,
}},
{"newSplit", ActionDefinition{"Create a new split"}},
Expand Down
6 changes: 6 additions & 0 deletions src/controllers/hotkeys/HotkeyController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,12 @@ void HotkeyController::addDefaults(std::set<QString> &addedHotkeys)
this->tryAddDefault(addedHotkeys, HotkeyCategory::Split,
QKeySequence("F10"), "debug",
std::vector<QString>(), "open debug popup");
this->tryAddDefault(addedHotkeys, HotkeyCategory::Split,
QKeySequence("Ctrl+Alt+N"), "popupOverlay", {},
"open overlay");
this->tryAddDefault(
addedHotkeys, HotkeyCategory::Split, QKeySequence("Ctrl+Shift+U"),
"toggleOverlayInertia", {"all"}, "toggle overlay click-through");
}

// split input
Expand Down
10 changes: 5 additions & 5 deletions src/messages/MessageColor.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "messages/MessageColor.hpp"

#include "singletons/Theme.hpp"
#include "messages/layouts/MessageLayoutContext.hpp"

namespace chatterino {

Expand All @@ -15,18 +15,18 @@ MessageColor::MessageColor(Type type)
{
}

const QColor &MessageColor::getColor(Theme &themeManager) const
const QColor &MessageColor::getColor(const MessageColors &colors) const
{
switch (this->type_)
{
case Type::Custom:
return this->customColor_;
case Type::Text:
return themeManager.messages.textColors.regular;
return colors.regularText;
case Type::System:
return themeManager.messages.textColors.system;
return colors.systemText;
case Type::Link:
return themeManager.messages.textColors.link;
return colors.linkText;
}

static QColor _default;
Expand Down
5 changes: 3 additions & 2 deletions src/messages/MessageColor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@
#include <QString>

namespace chatterino {
class Theme;

struct MessageColors;

struct MessageColor {
enum Type { Custom, Text, Link, System };

MessageColor(const QColor &color);
MessageColor(Type type_ = Text);

const QColor &getColor(Theme &themeManager) const;
const QColor &getColor(const MessageColors &colors) const;

QString toString() const;

Expand Down
Loading
Loading