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

Irregular Visibility of Drop-Down Button #12

Open
AndydeCleyre opened this issue Jun 7, 2017 · 9 comments
Open

Irregular Visibility of Drop-Down Button #12

AndydeCleyre opened this issue Jun 7, 2017 · 9 comments

Comments

@AndydeCleyre
Copy link

kargos 0.6.0
latte-dock 0.6.0.r316.g85eae84
plasma-desktop 5.10.0
qt5-base 5.8.0

With "Dropdown always visible" unchecked, the following behaviors are observed:

  1. Display dropdown button when and only when the dropdown is activated: demo
  2. Start like (1), but then always display the button: demo

I know (2) is not as intended, but I'm not sure about (1).

@lipido
Copy link
Owner

lipido commented Jun 7, 2017

Cannot reproduce it.
(1) is correct.
(2) is not correct, the dropdown should not start like (1), it should be always visible from start. In my case, this is the behavior I observe.

Can you paste your kargos script? Could you try without latte-dock?

My environment is Kubuntu 16.04 LTS:
plasma-desktop 5.5.5
qt5: 5.5.1

@AndydeCleyre
Copy link
Author

Sure, I created an empty panel and added a kargos applet with default settings except for the script:

image

Here's the script:

#!/usr/bin/env python3
from time import localtime, strftime

from donuts import Donut


fmt = " | font=Iosevka size=24"

lt = localtime()
hour, minute = lt[3:5]

anchor = Donut(hour + minute / 60)
surplus = minute % 5
anchor += Donut('.1') if surplus else 0
lead = f"{5 - surplus}→" if surplus else ''
print(f"{lead}{(anchor % 12).places(1, True)}{fmt}")
print('---')
print(f"{strftime('%I:%M %p', lt)}{fmt}")

@AndydeCleyre
Copy link
Author

I do wish the button could be hidden altogether, as displaying it on each click as in (1) disrupts the location of every other item on that panel.

@lipido
Copy link
Owner

lipido commented Jun 7, 2017

I'm not python expert, I get

  File "./script.py", line 15
    lead = f"{5 - surplus}→" if surplus else ''
                           ^
SyntaxError: invalid syntax

@lipido
Copy link
Owner

lipido commented Jun 7, 2017

When:

  • dropdown always visible: false
  • There are dropdown items (lines after ---)

The dropdown button appears and displaces other widgets. The only alternative is an always visible dropdown button, like the one in the "Status & Notifications" widget, whose dropdown button is always visible.

@AndydeCleyre
Copy link
Author

Sorry, I didn't realize you wanted to run my script, I didn't include a custom library it uses anyway. But I get the same behavior with:

#!/bin/bash
echo "1→2.5 | font=Iosevka size=24"
echo "---"
echo "2:24 | font=Iosevka size=24"

The only alternative is an always visible dropdown button

Is it a specific design decision to rule out a never-visible dropdown button?

@lipido
Copy link
Owner

lipido commented Jun 8, 2017

Ok, I have tested it.

I've set Dropdown always visible to true.
I addition, I did

killall plasmashell
plasmashell

And the dropdown button appears from the very beginning.

When you restart plasmashell from the console, a lot of output is seen (logs
from every widgets of plasma). Can you paste this log to see if there is
something strange?

@AndydeCleyre
Copy link
Author

I'm no longer experiencing this bug. ¯\_(ツ)_/¯

@AndydeCleyre
Copy link
Author

Shoot, it just re-appeared. I have the box unchecked, but the icon appears sometimes when the cursor starts or stops hovering.

https://streamable.com/kgxf6

Interestingly, this behavior stopped while I disabled compositing, and resumed when I re-enabled it.

Right now I'm using this script, with rotation at 8 and preferred height at 300:

now_playing.5s.py:

#!/usr/bin/env python3
from plumbum.cmd import playerctl
from plumbum import ProcessExecutionError
fmt = " | font='Iosevka Light' size=21"
get = playerctl['metadata']
def resize(txt, size, pre='» ', post=' «', ellipsis='center'):
    free = size - len(txt)
    if free >= 0:
        a, b = divmod(free, 2)
        return f"{pre}{' ' * a}{txt}{' ' * (a + b)}{post}"
    elif ellipsis == 'end':
        return f"{pre}{txt[:size - 1]}{post}"
    elif ellipsis == 'center':
        a, b = divmod(size - 1, 2)
        return f"{pre}{txt[:a + b]}{txt[-a:]}{post}"
try:
    title, artist = get('title'), get('artist')
except ProcessExecutionError:
    print(f"{fmt} iconName=spotify-indicator bash=spotify onclick=bash")
else:
    size = min(15, max(len(artist), len(title)))
    print(f"{resize(artist, size)}{fmt}")
    print(f"{resize(title,  size)}{fmt}")
    print('---')
    print(f"{title}       {fmt}", "iconName=media-album-track")
    print(f"{artist}      {fmt}", "iconName=view-media-artist")
    print(f"{get('album')}{fmt}", "iconName=media-album-cover")

@AndydeCleyre AndydeCleyre reopened this Oct 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants