Opened 8 years ago

Closed 5 years ago

#8156 closed enhancement (fixed)

Installing Workspaces into Deskbar should be easier

Reported by: rq Owned by: axeld
Priority: normal Milestone: R1
Component: Applications/Workspaces Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

I just figured out today that I actually can install a Workspaces replicant into Deskbar. But it's quite cumbersome: one has to manually resize the Workspaces window and then drag a replicant. I would like to suggest adding a context menu item which would automatically create a replicant of optimum height in the Deskbar.

One possible caveat is that this should probably only be enabled when all workspaces are arranged in a horizontal strip, because Deskbar only accepts replicants up to certain height.

Attachments (3)

Workspaces.patch (3.4 KB) - added by rq 8 years ago.
Patch adding the "Live in the Deskbar" item to the context menu
workspaces2.patch (5.6 KB) - added by rq 8 years ago.
Alternative patch, also removes any "About" functionality
workspaces-deskbar-correct-width.patch (1.5 KB) - added by rq 8 years ago.
Additional patch, which implements smarter calculation of the replicant size.

Download all attachments as: .zip

Change History (20)

Changed 8 years ago by rq

Attachment: Workspaces.patch added

Patch adding the "Live in the Deskbar" item to the context menu

comment:1 Changed 8 years ago by rq

Has a Patch: set

comment:2 Changed 8 years ago by rq

The attached patch adds a "Live in the Deskbar" item to the context menu. It's not ideal though: I hardcoded the size of the deskbar replicant instead of calculating it properly, since I have no idea how to implement it. I'd say idealy its dimentions would be calculated somewhat like this:

Height = 15px
Width = (ScreenWidth / ScreenHeight * numHorizontalDesktops / numVerticalDesktops * 14 + 1) px
(note I multiplied by 14 instead of 15 to account for borders between and around the desktop previews)

Last edited 8 years ago by rq (previous) (diff)

Changed 8 years ago by rq

Attachment: workspaces2.patch added

Alternative patch, also removes any "About" functionality

comment:3 Changed 8 years ago by rq

mmadia suggested that I also get rid of the "About Workspaces" menu item. Second patch does that, but with a little caveat: a replicant will still have this non-functional About menu item.

comment:4 in reply to:  3 ; Changed 8 years ago by mmadia

Replying to rq:

mmadia suggested that I also get rid of the "About Workspaces" menu item. Second patch does that, but with a little caveat: a replicant will still have this non-functional About menu item.

It's best to move the removal of About Workspaces to a new ticket. Even better to have the patch independant from this ticket's patch.

comment:5 in reply to:  4 Changed 8 years ago by rq

Replying to mmadia:

It's best to move the removal of About Workspaces to a new ticket. Even better to have the patch independant from this ticket's patch.

These being two separate enhancements is the reason why I didn't mark the first patch as obsolete. The two patches would likely be conflicting though, or depend on each other. In any case, I'm happy to create a separate ticket and a new patch for it once this gets reviewed and approved.

Bare in mind though, that I'm not a skilled coder, so if the patch here will need improvements, it's quite likely that I won't be able to add them.

comment:6 Changed 8 years ago by mmu_man

Committed a reworked version as hrev43367. I left the about issue out though.

comment:7 Changed 8 years ago by rq

I've spun off the About issue into #8165.

Changed 8 years ago by rq

Additional patch, which implements smarter calculation of the replicant size.

comment:8 Changed 8 years ago by mmu_man

Applied as hrev43430, Thanks. I suppose we can close it now?

comment:9 Changed 8 years ago by rq

Yep, thank you!

comment:10 Changed 8 years ago by rq

hm, I see you made another checkin, which decreases both width and height by 1 (hrev43432). Why would you do that? The replicant works correctly without it.

comment:11 Changed 8 years ago by mmu_man

Because the rect was actually created with 1 more pixel height and width than advertised. If you want 17 as height then use 17. It actually works but it's larger than others like ProcessController. OTOH it looks better with 2-rows workspaces setup but well...

comment:12 in reply to:  11 Changed 8 years ago by rq

Replying to mmu_man:

Because the rect was actually created with 1 more pixel height and width than advertised. If you want 17 as height then use 17. It actually works but it's larger than others like ProcessController. OTOH it looks better with 2-rows workspaces setup but well...

weird... 1) I was pretty sure that Deskbar would simply not accept replicants higher than 16px. Does it accept them for you? 2) so (0,0,100,16) actually means that the replicant is 17px tall? Is that because the first arguments are zero?

comment:13 in reply to:  11 ; Changed 8 years ago by rq

Replying to mmu_man:

Because the rect was actually created with 1 more pixel height and width than advertised. If you want 17 as height then use 17. It actually works but it's larger than others like ProcessController. OTOH it looks better with 2-rows workspaces setup but well...

Actually, I think you should probably fix my comment and initial constants too then (to state that a replicant can be 17x130). My goal was to have the replicant as tall as possible, and not exceed width allowed in Deskbar's vertical mode.

Should I attach another followup patch, or can you change the constants yourself?

PS. I have no idea why ProcessController would use a replicant that is 1px smaller than it can be. Perhaps it (and other applications, if any) should be fixed too.

comment:14 Changed 7 years ago by Disreali

Any progress?

comment:15 Changed 6 years ago by mmadia

Has a Patch: unset

comment:16 in reply to:  13 Changed 6 years ago by mmadia

Replying to rq:

Replying to mmu_man:

Because the rect was actually created with 1 more pixel height and width than advertised. If you want 17 as height then use 17. It actually works but it's larger than others like ProcessController. OTOH it looks better with 2-rows workspaces setup but well...

Actually, I think you should probably fix my comment and initial constants too then (to state that a replicant can be 17x130). My goal was to have the replicant as tall as possible, and not exceed width allowed in Deskbar's vertical mode.

Should I attach another followup patch, or can you change the constants yourself?

A followup patch would be appreciated -- ideally one that is made with git format-patch. This will give you a better level of recognition for your contribution.  Thanks!

comment:17 Changed 5 years ago by pulkomandy

Resolution: fixed
Status: newclosed

Nothing to do here, patches were applied already.

Note: See TracTickets for help on using tickets.