lipido / kargos

KDE Plasma port of GNOME Argos and OSX BitBar
GNU General Public License v3.0
126 stars 13 forks source link

Option to display Run/Go button or display just a hover effect #3

Closed lipido closed 7 years ago

lipido commented 7 years ago

@trmdi suggested: "Could you give an option to display Run/Go button or display just a hover effect like the Share button, or even no effect at all." #2

lipido commented 7 years ago

In lines where bash and href are specified... Which action should I take? In addition, when you have dropdown items, the click is needed to expand the full contents.

trmdi commented 7 years ago

This should only apply to the line before the line echo "---". And take the first matched bash/href.

lipido commented 7 years ago

But the line before echo --- is the line that appears in the panel and, right now, if you do click on it, a dropdown appears with the lines after echo ---

trmdi commented 7 years ago

If so, dropdown should be disabled when the sh file has bash/href on the echo line before echo "---"

lipido commented 7 years ago

Mmmm... I have a plugin which has several "rotating" messages before echo "---" with href and also several messages after echo "---" with href. I want to see in the dropdown. I think it is important not to loss functional possibilities by simply trying to tune appearance.

trmdi commented 7 years ago

Easy. Add a new onClick flag:

For example:

echo "abcd | bash='blabla' onClick=bash"
lipido commented 7 years ago

Ok, and in the following case...

echo "abcd | bash=blabla href=link onclick=bash"

... the Go Button (only) should appear. If onclick is href, the Run Button will appear instead.

I think this could be implemented. However, I think that the dropdown should be accessible in some way if there are lines after echo "---", of course. In such a case, making them inaccessible is a strange behavior. A solution would be, for example, to add a new button (like Go and Run) to show the dropdown (of course, if there are no lines after '---', this button will not appear).

trmdi commented 7 years ago

No, I mean, if there is onclick, both Run and go is not displayed at all, and the behavior will be as my above comment. Otherwise, it will appear as before. This is the configuration of the user. If he does want to display the Run/Go button, and the dropdown menu, he wouldn't use that onclick

lipido commented 7 years ago

What if the user wants to run a command by doing click and also to go to a link with href? Easy, set the href and the Go Button will appear.

With my proposal, you can do anything:

echo "Run with click (no buttons appear) | bash=command onclick=bash"
echo "Go to web with click (no buttons appear) | href=command onclick=href"
echo "Run with click (link with Go button) | bash=command href=link onclick=bash"
echo "Go to web with click (run with Run button) | bash=command href=link onclick=href"
trmdi commented 7 years ago

Yeah, It looks ok now. Let implement. Waiting for the next update. 👍

lipido commented 7 years ago

Do you mean only one line in the file?

echo "Run with click (no buttons appear) | bash=command onclick=bash"

This line will appear in the panel and if clicked the command is run and the dropdown do not appear since it is empty (no lines after ---).

trmdi commented 7 years ago

Can we activate the dropdown menu through the right mouse clicking?

lipido commented 7 years ago

I personally prefer a 'down-arrow' button to dropdown.

trmdi commented 7 years ago

So, what about display the "down-arrow" if there is at least one echo after echo --- ?

lipido commented 7 years ago

yes, that's what I said.

trmdi commented 7 years ago

And an echo before echo --- without onclick should do nothing on clicking on the title (not the run or go button) Because since now we access the dropdown menu through the arrow icon. Is it ok? Edit: this case has no issue. Never mind.

lipido commented 7 years ago

Mmmm, paste here the entire program to confirm...

trmdi commented 7 years ago

For example:

echo "google | href=link onclick=href"
echo `date`
echo "---"
echo "dropdown item"

When we click on the date, dropdown need not be display. We would show the dropdown through the arrow icon. Edit: no issue with this case. Never mind. ...waiting for your update.

lipido commented 7 years ago

Mmmm, this would be complicated. I would like to treat each line independently, so, since echo date does not have any attributes, the default behavior is to show the dropdown when clicking it. What about of include none value in onclick?:

echo "google | href=link onclick=href"
echo "`date` | onclick=none"
echo "---"
echo "dropdown item"
trmdi commented 7 years ago

Yeah, click on the date to show the dropdown menu has no problem. But if there is a onclick=none would make the widget be more and more flexible.

lipido commented 7 years ago

Yes, for confirm

echo "google | href=link onclick=href" # arrow button appears since onclick is for href
echo "`date` | onclick=none" # arrow button still showing since onclick is disabled
echo "---"
echo "dropdown item"

But here

echo "google | href=link onclick=href" # arrow button appears since onclick is for href
echo "`date`" # arrow button **disappears** since we can access it via click
echo "---"
echo "dropdown item"
trmdi commented 7 years ago

I don't think there is a problem if click to the date opening the dropdown, so, onclick=none is not necessary. The down-arrow button, I think its visibility should to be able to config through a preferred checkbox variable, similar to the preferred width/height of the widget.

lipido commented 7 years ago

Yes, It is another way. If we always show the arrow button it is more easy to implement. The onclick is still valid as we defined (except that none value is not needed).

trmdi commented 7 years ago

So for Summary, I think these things need to be implemented: 1, add onclick attribute 2, add a preferred variable for the visibility of the arrow button.

lipido commented 7 years ago

Ok, the dropdown button is now committed (it only appears when the user hovers). The dropdown arrow button is the "new standard". I think it is much better (by now there is no option to change to the 'old-times'). The onclick is also committed.

Please, try the latest version in the repo.

trmdi commented 7 years ago

There are some issues:

1,

echo "en bash=cmd onclick=bash"
echo "---"
echo "Dropdown item..."

the arrow would appear when mouse hovers over the "en" text, and the text "en" would float to the left, the mouse would be at the position of the arrow. So user has to move the mouse to the left a bit to click to "en" icon. => A little annoyed. 2,

echo "en bash=cmd"
echo "---"
echo "Dropdown item..."

when the mouse hovers the "en" icon, it changes to the Run button which is too long, end the text "en" disappear, like this: [other widget] [too long Run button] [other widget]

I suggest these: 1, Add a variable to set the dropdown arrow always appear or not. 2, Let the "en" icon always appear, and make the Run/Go button shorter, maybe a small icon rather than the long button. Like this: [other widget] en [run icon] [dropdown arrow][other widget] (for the icon, I suggest monochrome icon style, for example: Play icon and Link icon...)

lipido commented 7 years ago

I have committed a new version with these two suggestions (it was not so easy as it seemed at first sight).

  1. Preferences have been rearranged into two sections, including the new dropdown always visible option.
  2. The small buttons appear if your label is less than 100px width, and are permanently visible.

Try again. I see this with your script:

image

trmdi commented 7 years ago
  1. When the label is >= 100px width, why don't you you let the buttons be small and icon as well as not-overlap the label as they appear when the label <100px ? I think that is nicer.
  2. About the buttons effect, can you make it like this:
    • The arrow button: exactly like the one of the system tray widget. (no border at all)
    • The Run/Go button: remove all the border, set the alpha color (alpha in #rgba) about 90% when the mouse is outside the button, and 100% when the mouse is inside.
  3. Why can't I click the "A long long long... string" to open the dropdown menu now? It doesn't have onclick=none
 echo "A long long long long long long long long long long long string | bash=cmd"
echo "en | bash=cmd href=http://1.2.3"
echo "---"
echo "dropdown item"
lipido commented 7 years ago

Done points 1 and 3. Please test. Regarding point 2, I will open a different issue, since it is pure aspect related.

trmdi commented 7 years ago

@lipido You forgot to git push :( The latest commit is: https://github.com/lipido/kargos/commit/3ccc87dfbd4672b646988e76fe46747d909d8dc1

lipido commented 7 years ago

sorry!

trmdi commented 7 years ago

Confirm that points 1 and 3, they work as expected. 👍