-
-
Notifications
You must be signed in to change notification settings - Fork 51
Lib/Indicator: Add enum for indicator position #640
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
base: master
Are you sure you want to change the base?
Changes from 7 commits
3bdf514
134b9ee
febaf16
fe1598a
dde4fde
de20e24
abb8978
0cfb034
34707a5
bddc137
f5306b1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| /* | ||
| * Copyright (c) 2011-2015 Wingpanel Developers (http://launchpad.net/wingpanel) | ||
| * | ||
| * This program is free software; you can redistribute it and/or | ||
| * modify it under the terms of the GNU General Public | ||
| * License as published by the Free Software Foundation; either | ||
| * version 2 of the License, or (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| * General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public | ||
| * License along with this program; if not, write to the | ||
| * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
| * Boston, MA 02110-1301 USA. | ||
| */ | ||
|
|
||
| public enum Wingpanel.IndicatorPosition { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Maybe putting this into Indicator.vala is fine? I agree with having its own file feels overkill. |
||
| LEFT, | ||
| CENTER, | ||
| RIGHT; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -247,12 +247,21 @@ public class Wingpanel.Widgets.Panel : Gtk.EventBox { | |
| private void add_indicator (Indicator indicator) { | ||
| var indicator_entry = new IndicatorEntry (indicator, popover_manager); | ||
|
|
||
| switch (indicator.code_name) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have specific code for Applications menu and DateTime indicator elsewhere, did you revisit them and check that we don't need fix them?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll double check |
||
| case Indicator.APP_LAUNCHER: | ||
| // Workaround until both indicators get their own position prop | ||
teamcons marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if (indicator.code_name == Indicator.APP_LAUNCHER) { | ||
| indicator.position = IndicatorPosition.LEFT; | ||
| }; | ||
|
|
||
| if (indicator.code_name == Indicator.DATETIME) { | ||
| indicator.position = IndicatorPosition.CENTER; | ||
| }; | ||
|
|
||
| switch (indicator.position) { | ||
| case IndicatorPosition.LEFT: | ||
| indicator_entry.set_transition_type (Gtk.RevealerTransitionType.SLIDE_RIGHT); | ||
| left_menubar.add (indicator_entry); | ||
| left_menubar.insert_sorted (indicator_entry); | ||
| break; | ||
| case Indicator.DATETIME: | ||
| case IndicatorPosition.CENTER: | ||
| indicator_entry.set_transition_type (Gtk.RevealerTransitionType.SLIDE_DOWN); | ||
| center_menubar.add (indicator_entry); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if we may leave this I'm concerning that possibly the indicator order of CENTER could be different every time when the panel starts.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Properly centering opens a lot of uneasy questions: Im aware i am doing a PR for a new functionality, but also it is directed at a niche hacky extension that relies on using an unsupported (for user software) packaging system So when doing the code i was unsure whether to address this properly, or wait until there is actual demand for actually putting in the center in a more proper way. Or also only allow LEFT or RIGHT. |
||
| break; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.