Discord-like Quick Switcher (#1588)
* 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 commit is contained in:
@@ -78,6 +78,8 @@
|
||||
<file>split/move.png</file>
|
||||
<file>split/right.png</file>
|
||||
<file>split/up.png</file>
|
||||
<file>switcher/plus.svg</file>
|
||||
<file>switcher/switch.svg</file>
|
||||
<file>tlds.txt</file>
|
||||
<file>twitch/admin.png</file>
|
||||
<file>twitch/automod.png</file>
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="210mm"
|
||||
height="297mm"
|
||||
viewBox="0 0 210 297"
|
||||
version="1.1"
|
||||
id="svg8"
|
||||
inkscape:version="1.0 (4035a4fb49, 2020-05-01)"
|
||||
sodipodi:docname="plus.svg">
|
||||
<defs
|
||||
id="defs2" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.7"
|
||||
inkscape:cx="237.44516"
|
||||
inkscape:cy="499.16577"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:measure-start="627.601,711.894"
|
||||
inkscape:measure-end="628.106,660"
|
||||
inkscape:pagecheckerboard="true"
|
||||
inkscape:window-width="1918"
|
||||
inkscape:window-height="1053"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="25"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:document-rotation="0">
|
||||
<inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid815" />
|
||||
</sodipodi:namedview>
|
||||
<metadata
|
||||
id="metadata5">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Ebene 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1">
|
||||
<g
|
||||
id="g12"
|
||||
transform="matrix(2.1771058,0,0,2.1771058,-134.91094,-141.35877)">
|
||||
<path
|
||||
id="path834"
|
||||
style="fill:#5e5e5e;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.786;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 154.50333,127.59624 A 43.750744,43.750744 0 0 1 110.75259,171.34698 43.750744,43.750744 0 0 1 67.001842,127.59624 43.750744,43.750744 0 0 1 110.75259,83.845493 43.750744,43.750744 0 0 1 154.50333,127.59624" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="rect817"
|
||||
d="m 104.89396,104.16173 v 17.57589 H 87.318064 v 11.71725 h 17.575896 v 17.57589 h 11.71727 v -17.57589 h 17.57589 v -11.71725 h -17.57589 v -17.57589 z"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.435107;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.6 KiB |
@@ -0,0 +1,104 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
sodipodi:docname="switch.svg"
|
||||
inkscape:version="1.0 (4035a4fb49, 2020-05-01)"
|
||||
id="svg8"
|
||||
version="1.1"
|
||||
viewBox="0 0 210 297"
|
||||
height="297mm"
|
||||
width="210mm">
|
||||
<defs
|
||||
id="defs2">
|
||||
<inkscape:path-effect
|
||||
effect="spiro"
|
||||
id="path-effect846"
|
||||
is_visible="true" />
|
||||
<inkscape:path-effect
|
||||
is_visible="true"
|
||||
id="path-effect842"
|
||||
effect="spiro" />
|
||||
<inkscape:path-effect
|
||||
only_selected="false"
|
||||
apply_with_weight="true"
|
||||
apply_no_weight="true"
|
||||
helper_size="0"
|
||||
steps="2"
|
||||
weight="33.333333"
|
||||
is_visible="true"
|
||||
id="path-effect838"
|
||||
effect="bspline" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
inkscape:document-rotation="0"
|
||||
showguides="false"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:window-y="25"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-height="1053"
|
||||
inkscape:window-width="1918"
|
||||
inkscape:pagecheckerboard="true"
|
||||
inkscape:measure-end="452.742,560.248"
|
||||
inkscape:measure-start="452.742,588.189"
|
||||
showgrid="false"
|
||||
inkscape:current-layer="layer1"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:cy="518.41498"
|
||||
inkscape:cx="382.6533"
|
||||
inkscape:zoom="0.35"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
borderopacity="1.0"
|
||||
bordercolor="#666666"
|
||||
pagecolor="#ffffff"
|
||||
id="base">
|
||||
<inkscape:grid
|
||||
id="grid815"
|
||||
type="xygrid" />
|
||||
</sodipodi:namedview>
|
||||
<metadata
|
||||
id="metadata5">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
id="layer1"
|
||||
inkscape:groupmode="layer"
|
||||
inkscape:label="Ebene 1">
|
||||
<circle
|
||||
r="95.25"
|
||||
cy="148.83635"
|
||||
cx="105.97791"
|
||||
id="path834"
|
||||
style="fill:#5e5e5e;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.7112;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<g
|
||||
transform="matrix(1.5315391,0,0,1.5315391,-51.342168,-65.4613)"
|
||||
id="g1462">
|
||||
<path
|
||||
sodipodi:nodetypes="cccccccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path870"
|
||||
d="m 64.225375,157.86151 c 0,0 36.412935,10.20456 55.562495,3.37954 v 7.39282 l 21.42726,-21.18896 -21.42722,-6.06995 v 7.39287 c -16.9044,6.0364 -55.562535,-4.13549 -55.562535,-4.13549 z"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.786;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<path
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.786;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 141.21513,121.98463 c 0,0 -36.41293,-10.20456 -55.562491,-3.37954 v -7.39282 l -21.42726,21.18896 21.42722,6.06995 v -7.39287 c 16.904401,-6.0364 55.562531,4.13549 55.562531,4.13549 z"
|
||||
id="path880"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccccccc" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.5 KiB |
Reference in New Issue
Block a user