* Split up Window Layout loading into a loading and application stage
Previously, we were creating UI elements at while we were reading the window-layout.json file.
We now read the window-layout.json file fully first, which results in a
WindowLayout struct which is built up of a list of windows with a list
of tabs with a root node which contains containers and splits.
This WindowLayout can then be applied.
This will enable PRs like #1940 to start Chatterino with Window Layouts
that aren't defined in a json file.
This commit has deprecated loading of v1 window layouts (we're now on v2). If a v1 window layout is there, it will just be ignored and Chatterino will boot up as if it did not have a window layout at all, and on save that old window layout will be gone.
* Fix compile error for mac
This is done by deliberately setting and reading the enabled state of
the widget whenever the stateChanged event happens.
If the stateChanged event happens while the widget is not enabled, we
know the event must have been triggered by our "check user follow state"
event, and then we don't act upon that event
On macOS, trying to display a dialog before showing the main window
(like when starting minimized) leads to a crash. The dialog will now
show before the main window is opened, preventing this issue.
* (#1874) Disable update checking for unsupported platforms
As described #1874, only Windows, macOS and GNU/Linux are officially
supplied with builds. Thus checking for updates is unnecessary if we
are e.g. on FreeBSD, OpenBSD, illumos distros and possibly other
Operating Systems.
This fixes#1874 by ifdef-ing the 3 officially supported platforms
when checking for updates. Otherwise a debug warning will be emitted
and in the settings the checkbox for beta-updates is hidden and
replaced by a message, explaining the reason for why there are no beta
updates.
* Update CHANGELOG
In accordance with #1874
* (#1874) Move platform check into checkForUpdates
As discussed in #1914
* (#1874) Move check for supported OS to a seperate function.
As requested in #1914
* fixed SearchWindow memory leak
* Update CHANGELOG.md
* added DebugCount for BaseWindow
* [Bug Fix] Color of second user highlight cannot be set (#1898)
* Highlighting: Fix bug preventing user highlight from being set
Before this commit, only the row of a clicked cell was checked, but not
the tab it was clicked in.
Since the "Whispers" row is the second row in the "Messages" tab on the
highlighting page, the color picker was not opened for the second entry
in the "Users" tab either. This commit fixes the bug by also checking
tab the cell was clicked in.
* Update CHANGELOG.md
* Emote Popup Improvements (#1895)
* Put exact matching emotes first
* Close GenericListView on Escape press
* smol fix
* fixed emote input when not in the first char
* fixes#1902
* closes#1904
Co-authored-by: Leon Richardt <leon.richardt@gmail.com>
Co-authored-by: Daniel <24928223+dnsge@users.noreply.github.com>
* Highlighting: Fix bug preventing user highlight from being set
Before this commit, only the row of a clicked cell was checked, but not
the tab it was clicked in.
Since the "Whispers" row is the second row in the "Messages" tab on the
highlighting page, the color picker was not opened for the second entry
in the "Users" tab either. This commit fixes the bug by also checking
tab the cell was clicked in.
* Update CHANGELOG.md
* Add missing includes
We would normally have these included in another file already, or even
the precompiled headers, but having the files included here too makes
testing single parts easier.
* Modify the regex building of highlight phrases for non-regex phrases
For phrases like !test, the word boundary checking we did before was not
enough, so we now check for either a word boundary, a whitespace
character, or the line start/end.
* Add tests for ensuring I haven't fully broken the highlight system
* Add changelog entry
* Proof of Concept for Quick Switcher
* Fix crash when suggestions are empty
* QuickSwitcher: Use tab name instead of a single channel
* Rebase later
* Add missing include for <functional>
* Move QuickSwitcher related classes into own subfolder
* Refactor switcher list items
Now, items are responsible for taking the right action when selected in
the switcher list. This should allow for more focused code and
responsibilities.
* Add note about memory management
* Add option to open channel in a new tab
* Add support for using the mouse
* Spawn switcher popup in the middle of the window
Works reliably on i3 at least. Might need some additional testing on
other WMs (and especially on Windows!).
* Add some icons for switcher items
Note that the final design of the list is not final but I do plan to
incorporate these in the future.
* Set Qt::Dialog window flag on switcher popup
Prevents tiling window managers like i3 from trying to tile the window.
* Rename "SwitcherItem" to "AbstractSwitcherItem"
* Add comments about what items are inserted
* Use custom model and view
Still missing: Currently selected item is not highlighted yet. You can
move between selected items with tab and arrow keys though.
* Add helper function to convert QVariant to AbstractSwitcherItem *
* Remove useless constant
* Highlight currently selected switcher item
* Use a different method for centering QuickSwitcherPopup window
* QuickSwitcherModel: Add documentation
* Add default parameter to QuickSwitcherModel::rowCount
* QuickSwitcherPopup: Add comments
* Remove outdated TODO
* QuickSwitcherModel: Init vector with default capacity
* Remove outdated comment
* Add comment about 0 ms timeout interval
* NewTabItem: Simplify interface
* Only fetch opened splits once
This is better than the prior approach since opened splits cannot change
anyways while the switcher is open.
* Use SplitContainer to pass information instead of custom type
* Allow searching for tab titles as well
Before this commit, only channel names could be searched.
* Refactor switcher item interface to be more flexible
Also show tab name and channel name in the switcher list.
* Add documentation for AbstractSwitcherItem
* Add documentation for NewTabItem
* Add comments about {begin,end}{Insert,Remove}Rows
* Remove unused method
* Replace magic size with named constant
* Add change log entry
Co-authored-by: fourtf <tf.four@gmail.com>
This makes it so that we consistently start with the same values after
having cleared a ChannelView.
Example place where this happens: UserInfoPopup when user messages are
loaded and refreshed
This has historically been done in the Recent Messages API, but this functionality is being moved to Chatterino instead
* Remove `clearchatToNotice=true` query parameter to the Recent Messages API
This ensures that the layout will survive for the lifetime of the menu,
so any of the menu actions can with confidence do things with the
layout, not having to worry whether it's dead or not.
This means that the user, while having the message menu open, could have
one extra MessageLayout alive. I have ensured that when the menu dies
the reference to the shared pointer dies with it.