22 Commits

Author SHA1 Message Date
b0ebe468aa
Feature: Add initial preferences dialog
Add an initial preferences dialog, which allows the user to easily
reorder the Gnome Shell top bar items.
2021-05-25 00:24:44 +02:00
a3f5ad96f4
Fix: Consider all boxes, when adding items to box orders
Fix the following issues:

1. Let's assume we have a default (reduced) Gnome Shell top bar like
   this:
   - left box: activities, appMenu
   - center box: dateMenu
   - right box: keyboard, aggregateMenu
   And now assume, we changed the (reduced) configured box orders to
   define the top bar like this (while the extension wasn't running for
   this test case):
   - left box: activites, keyboard, appMenu
   - center box: dateMenu
   - right box: aggreateMenu
   Now for the old version of this extension, the following would
   happen:
   The extension would put the "keyboard" into the configured right box
   order on extension start, despite it being already in the configured
   left box order.
   This would happen, because the extension would look at each box
   individually at startup to determine if new items should be added to
   its box order.
   And therefore it would add "keyboard" to the configured right box
   order, leading to the (reduced) corrupted box orders looking like
   this:
   - left box: activites, keyboard, appMenu
   - center box: dateMenu
   - right box: keyboard, aggreateMenu
   And then, since the extension orders the top bar initially on start,
   the extension would put the "keyboard" item into the right box (since
   the right box would get ordered after the left box).
   (And even if the config situation were different, so that the
   originally configured box would have been ordered after the wrongly
   configured box, the configured box orders would have still been
   corrupted.)

   Fix this issue by considering all top bar boxes in
   `_createUpdatedBoxOrder/s`.

2. Let's assume we have the default (reduced) configured box orders like
   this:
   - left box:
   - center box:
   - right box: appindicator-kstatusnotifieritem-KeePassXC
   And now assume, we changed the (reduced) configured box orders to
   define the top bar like this (while the extension and the
   "KStatusNotifierItem/AppIndicator Support" extension weren't running
   for this test case):
   - left box: appindicator-kstatusnotifieritem-KeePassXC
   - center box:
   - right box:
   Now we would first start this extension and then the
   "KStatusNotifierItem/AppIndicator Support" extension.
   For the old version of this extension, the following would happen:
   The extension would have put the KeePassXC
   KStatusNotifierItem/AppIndicator into the configured right box order
   and the right box, leading to the (reduced) corrupted configured box
   orders looking like this:
   - left box: appindicator-kstatusnotifieritem-KeePassXC
   - center box:
   - right box: appindicator-kstatusnotifieritem-KeePassXC
   This would happen, because the logic for the `Panel._addToPanelBox`
   overwrite assumed that the new item should be added to the box the
   item addition initiator requested (even tho the item might be
   configured to go into another box).

   Fix this issue by considering all top bar boxes for the
   `Panel._addToPanelBox` overwrite.

One can see based on those two test cases, how those two issues create
problems.
So fix the issues as explained above and fix them together in this one
commit, since they are related.
2021-05-21 04:15:20 +02:00
4faf976155
Update: Handle permutations of outdated box orders getting saved better 2021-05-17 19:44:00 +02:00
c2c4237bd3
Refactor: Move creation of updated box order into own method
Move the creation of an updated box order into an own method, so that
this method can be used elsewhere in the future to easily get an updated
box order.
2021-05-17 19:37:05 +02:00
c55b9e2648
Feature: Make it possible to move items to other top bar boxes 2021-05-17 18:09:06 +02:00
b938d7a28f
Other: Introduce ESLint for code linting 2021-05-17 17:45:22 +02:00
0c845336e6
Other: License this project
License this project under the GNU General Public License version 3.
2021-05-17 14:37:57 +02:00
0b7a15e55c
Breaking: Handle AppIndicator/KStatusNotifierItem items better
Handle AppIndicator/KStatusNotifierItem items differently (and better)
for the following reasons:
- These items have a role, which isn't very helpful for identifying the
  associated application.
- These roles seem to be different for each application run.
- There can be multiple AppIndicator/KStatusNotifierItem items for the
  same application (multiple instances of that application running).
2021-05-17 13:16:29 +02:00
572c6b69c1
Refactor: Group "private" methods
Group "private" methods to make their purpose clearer.
2021-05-17 11:38:17 +02:00
a73ed96bda
Feature: Handle changes of configured box orders
Handle changes of configured box orders, by ordering the relevant top
bar items according to the configured box order, which changed.
2021-05-16 21:32:30 +02:00
fd21ecb189
Refactor: Move individual top bar box ordering into own method
Move the individual top bar box ordering into own method, so that this
method can be used elsewhere in the future to easily order a single box.
2021-05-16 20:17:17 +02:00
2f0ecddfc8
Other: Add .editorconfigs
Add `.editorconfig`s, to help maintain a consistent coding style.
Also apply the new style to existing files.
2021-05-16 20:05:58 +02:00
f581935f85
New: Overwrite Panel._addToPanelBox
Overwrite `Panel._addToPanelBox` of Gnome Shell `js/ui/panel.js` with a
custom method, which handles top bar item additions to make sure that
they are added in the correct position.
2021-05-14 13:19:27 +02:00
0fc62ae465
Refactor: Move valid box order creation into own method
Move the valid box order creation into an own method.
This makes the `_orderTopBarItems` method cleaner and allows other
methods to easily create valid box orders as well in the future.
2021-05-14 13:19:20 +02:00
0f3e1608a9
New: Order top bar items on enable
Order top bar items on extension enable according to the saved box
orders.
2021-05-14 13:18:35 +02:00
f8488a97f4
New: Add new top bar items to box orders on enable
Introduce box orders, which allow this extension to save the order top
bar items should be in.
On extension enable, save new top bar items to those box orders.
2021-05-14 13:18:35 +02:00
2851fe3aaa
Docs: Describe Panel._addToPanelBox logic
Describe what `Panel._addToPanelBox` does with the role and indicator it
gets.
2021-05-14 13:18:35 +02:00
821d849668
New: Add initial bare-bones extension source code
I'm using version 1 for the first development phase (like what major
version zero (0.y.z) is in Semantic Versioning 2.0.0), so that the first
production version then gets version 2.
2021-05-14 13:18:35 +02:00
1c7cafaff9
Docs: Add initial About_the_Top_(Menu)Bar.md
Add background documentation/information regarding the top (menu)bar.
2021-05-14 13:18:35 +02:00
db0237792d
Docs: Add annotated and cut down panel.js
Add an annotated and cut down `js/ui/panel.js` from gnome-shell/master
as background documentation/information for this extension.
2021-05-14 13:18:35 +02:00
49388737a4
Other: Specify a textwidth of 80 for JavaScript
Specify a textwidth of 80 for code of this repo in `.js` files.
Also add VSCode workspace settings to specify a textwith of 80.
2021-05-14 13:18:30 +02:00
1f1a958555
Docs: Specify commit message format
Add initial `CONTRIBUTING.md` specifying the commit message format to
use.
2021-05-14 13:17:52 +02:00