Commit Graph
70 Commits
Author SHA1 Message Date
John Scipione 446139c354 Deskbar: Fix open prefs window incorrectly sets Deskbar window state.
Set window location but do not Invoke() when opening prefs window.
We do not want the Deskbar window location to change on open/show
prefs window, only when you change the preference.

The root problem here is that we currently do not support horizontal
mini-mode in Deskbar preferences, only vertical. Consequently, opening
the prefs window switches Deskbar into vertical mini-mode when in
horizontal mini-mode. Leave the state alone so this doesn't happen.

Change-Id: Ife00e02f4bc16344fed47d23b9d768aa46b8d7f7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/11524
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
(cherry picked from commit 6674947bb98ba64da5af9d5de6f894850a194b98)
Reviewed-on: https://review.haiku-os.org/c/haiku/+/11533
2026-08-15 03:10:30 +00:00
John Scipione 4d2a3f8800 Deskbar: Add space between recent labels and counts in prefs.
This causes the count spinners to move over instead of stretching.

Change-Id: I8f8047a54a6a4ab4379eb77b5cbb08a069a69109
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10903
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
2026-05-05 01:02:16 +00:00
John Scipione b2e34aefca Deskbar: Update window location in preferences when window moves.
Create a _SetWindowLocation() convenience method. This gets called in
the constructor, on Show() and when the Deskbar window state changes.

Do not Invoke() on SetValue(), call Invoke() after except when Deskbar
tells preferences to update its value instead of the other way around.

When focused numpad 4 and left arrow set top left expando mode,
numpad 6 and right arrow set top right expando mode. These are the
"left" and "right" positions of Deskbar. We can safely assume that
bottom left/right expando mode will never be implemented, only top.

Add a small horizontal space between the window location control and
the checkboxes, they are a bit too close to each other.

Fixes #20057.

Change-Id: I43289e4bf0e021ca2665a4f65a135edf6faff29e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10835
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
2026-04-26 20:51:42 +00:00
François Revol 4e7218d2de deskbar: add a location selector similar to Screensaver "corner selector"
Makes it easier to discover that the deskbar can be moved.

Change-Id: I6964f3318bdffa0aaa922022851cb1b5ab46f9e7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3158
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2026-02-23 08:29:46 +00:00
John Scipione c53e74e22f Deskbar: style fixes related to preferences
Change-Id: I4405937066c5a1a78c63137fefa63a79f295a2a6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10327
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: nephele nephele <[email protected]>
2026-02-13 12:17:08 +00:00
Humdinger c273dc9f64 Apps & Prefs: Use B_TRANSLATE_SYSTEM_NAME() where appropriate
The application name should never appear in a translatable string.
Otherwise it will always show translated in the app, even if the
user configured the Locale prefs to not "Translate app and folder
names".
Always concatenate the B_TRANSLATE_SYSTEM_NAME'ed string.

Use a regular BAboutWindow in the Sounds prefs.

Change-Id: I85f02a3aa6c76b22266d495cf7514cc499bc31e8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10234
Reviewed-by: Adrien Destugues <[email protected]>
2026-01-19 11:41:50 +00:00
Augustin Cavalier 057b69a774 Deskbar & Translation: Use assignment operator instead of memcpy. 2019-05-24 16:00:38 -04:00
Augustin Cavalier df4074fbed Remove a lot of unused constants.
Spotted by Clang. No functional change intended.
2018-11-24 19:21:16 -05:00
Jérôme Duval 61e43a69e8 Deskbar: fix invalid static use of be_control_look. 2017-10-02 21:29:38 +02:00
Humdinger d0ac609964 Use B_USE_WINDOW_SPACING
Use B_USE_WINDOW_SPACING as inset from contents to window border.
Some whitespace cleanup.
2015-11-07 17:40:16 +01:00
John Scipione a0ba79fbff Split BSpinner into BAbstractSpinner and...
2 concrete classes which are currently implemented:
* BSpinner (works on int32s)
* BDecimalSpinner (works on doubles)

In addition BAbstractSpinner now inherits from BControl instead of
BView/BInvoker. This allowed for code simplification at the cost of needing to
cast for the decimal version because SetValue(int32 value) comes from BControl.

Also, add a spinner_button_style enum with 3 options:
* SPINNER_BUTTON_HORIZONTAL_ARROWS
* SPINNER_BUTTON_VERTICAL_ARROWS
* SPINNER_BUTTON_PLUS_MINUS

which sets the spinner arrows to either use horizontal arrows (left/right)
vertical arrows, (up/down), or +/- symbols (the default).

If the spinner button is using horizontal arrows you can decrement and increment
the spinner value by pushing control+left/right, otherwise you can increment and
decrement by pushing up or down. The reason for needing control is so that you
can move the cursor in the textbox otherwise.

Switch the 3 apps that are currently using BSpinners to use the integer variety
in Deskbar preferences, WebPostive preferences, and Screen preferences.
2015-08-22 15:15:08 -07:00
John Scipione 4f11457556 Deskbar: Add spinners to preferences 2015-08-22 15:15:04 -07:00
Ingo Weinhold 7e78b434f4 Merge remote-tracking branch 'haiku/master' into package-management
Conflicts:
	build/jam/HaikuImage
	build/jam/OptionalPackageDependencies
	build/jam/OptionalPackages
	build/scripts/build_cross_tools_gcc4
	src/add-ons/translators/icns/Jamfile
	src/add-ons/translators/jpeg/Jamfile
2013-07-08 14:01:00 +02:00
Rene Gollent a97ff1bb60 Adjust apps to conform to previous layout changes.
The Deskbar and Time preferences were both relying on BCheckBox's
previous unlimited max width to get their containing BBoxes to be the
right size. Adjust the box constraints to make this happen at the level
of the box instead.
2013-07-01 19:08:57 -04:00
Ingo Weinhold 26ea70667a Deskbar: use a virtual directory for the user-configurable menu
* Deskbar now uses ~/config/settings/deskbar/menu_entries for its menu,
  falling back to /system/data/deskbar/menu_entries, when the former
  doesn't exist. The latter always exists and is a virtual directory
  merging the deskbar/menu subdirectories of ~/config/settings/ and
  <any installation location>/data/. So, if a package provides a
  deskbar menu symlink, it is added automatically when the package is
  activated. The user can add own menu items by putting stuff into
  ~/config/settings/deskbar/menu/, only use their own organization by
  symlinking it to menu_entries, or do fun stuff by making menu_entries
  a customized virtual directory.
* HaikuImage: No longer create any deskbar menu symlinks in the user's
  settings directory. Instead add them to the Haiku package.
* OptionalPackages: At least for the optional packages that do have
  hpkgs, no longer create deskbar menu symlinks in the user's settings
  directory.
* Move all Deskbar settings files to ~/config/settings/deskbar/ and
  drop the "Deskbar_" prefix.
2013-06-29 14:58:52 +02:00
John Scipione d3a0b2dccf Deskbar prefs i18n updates. Fixes #8562
* AddGlue() to the Menu box to make it expand with wider translations.
* Order checkboxes vertically to better accomidate wider translations.
2013-03-16 08:12:50 -04:00
John Scipione 5bfc9c7091 Save and load prefs window position to and from a file. 2013-03-15 21:44:59 -04:00
John Scipione f49eecb564 Use horizontal strut instead of insets 2013-03-15 21:35:02 -04:00
John Scipione a3f512d524 Rename Recent items back to Menu and tweak to make fit.
* Put the Open in Tracker... button back in Menu.
* Put the window checkboxes in 2 columns.
* Use vertical struts instead of insets for spacing in a couple places.
2013-03-15 21:35:01 -04:00
John Scipione a601c3f172 Add 'Open menu in Tracker' button at bottom 2013-03-15 21:35:00 -04:00
John Scipione 633232da4c Reorder buttons.
Defaults then Revert both on left like Tracker and Locale and other preflets.
2013-03-15 21:34:59 -04:00
John Scipione 43917ef2e0 Refactor settings so that defaults get set in 1 place.
* Move desk_settings and clock_settings struct to a new header entitled
  'BarSettings.h' so it can be included in BarApp.h and PreferencesWindow.h.
* Refactor desk_settings to only include used, or at least relevant settings,
  some cruft had built up over time.
* Refactor the InitSettings() method, all the B_OK checking wasn't working so
  I removed it. Defaults get set up to and if the corresponding setting is
  found in the settings file it is replaced, else, it is not.
* Reorder the struct and code so it goes in the order that the settings appear:
  applications, then recent items, then window settings.
* Simplify the preferences window revert and defaults code based on using the
  prebuild desk_settings structs in BarApp instead of creating our own and
  copying. All initial setup is in the constructor.
2013-03-15 21:34:58 -04:00
John Scipione cb42238603 Destroy prefs window on close once again 2013-03-15 21:34:57 -04:00
John Scipione 1ec3d37252 Rename 'Sort running applications' to 'Sort applications by name' 2013-03-15 21:34:56 -04:00
John Scipione cb0602cf81 Implement Revert and Default buttons in Deskbar prefs 2013-03-15 21:34:36 -04:00
John Scipione 93a58e5028 Reformat Deskbar prefs all in one with no tabs 2013-03-15 21:33:59 -04:00
John Scipione 331c9098ea Move Deskbar prefs window to current workspace if hidden 2013-02-11 21:49:03 -05:00
John Scipione 74a0eef547 Cleanup, no functional change 2013-01-14 15:16:51 -05:00
John Scipione 075d3e60f4 Update Deskbar preferences to use tabs instead of listview 2013-01-14 14:24:42 -05:00
John Scipione 2e64288895 Change Application back to Applications in Deskbar prefs. 2012-12-23 12:21:00 -05:00
John Scipione 879fe42c09 Refactor Deskbar preferences window.
* Remove locking from Prefs window QuitRequested(), thanks Axel.
* Remove kConfigClose message, no longer needed since window sticks
  around and is hidden on close instead of being deleted.
* delete fPreferencesWindow on BarApp QuitRequested() so it will
  remove the memory used by preference window when Deskbar quits.
2012-12-21 16:16:39 -05:00
John Scipione ee70bd8b1f Hide and show Deskbar preference window
... instead of destroying and creating it each time.

This is taking another page from Tracker's book. It allows the prefs
window to maintain it's current state as long as the application
remains open. Since both Tracker and Deskbar are meant to always be
open this means that the state is kept all the time unless the app
crashes, quite useful.
2012-12-20 19:57:13 -05:00
John Scipione 0eacc85bc2 Style fixes, no functional change indented 2012-12-20 19:43:22 -05:00
John Scipione defcf2ebc4 Add newline at the end of PreferencesWindow.cpp
This completes the move of clock preferences from Deskbar to Time.

This closes #7331. Also closing #8769 as invalid as it has been
discussed to death and 12/24 hour setting seems to belong in Locale
prefs only.

Clock preferences have been moved into their own settings file as
well so perhaps will be moved to their own replicant in the future.
2012-12-20 18:58:09 -05:00
John Scipione 37fb25e0f8 On second thought, AddGlue to all 3 so the window stays the same height 2012-12-20 18:31:43 -05:00
John Scipione 9fd9f94dcc Make prefs window height depend on content 2012-12-20 18:31:42 -05:00
John Scipione c5b556a080 Rearrange Deskbar preferences to use a list view like Tracker
Instead of showing all Deskbar preferences at once, show them one
at a time using a list view to switch between them like Tracker
preferences.
2012-12-20 18:31:42 -05:00
John Scipione 31c0024d1b Add Deskbar clock settings to Time Preferences
* Added a new Clock tab to the Time preflet. Added Clock related
  controls there. They all function by communicating with Deskbar.
* Put controls in a BBox controlled by the Show clock checkbox.
  This more clearly shows that all the clock settings are dependent
  on the show clock setting since it doesn't matter what your clock
  settings are if you don't show the clock.
* Make revert work.
* Split clock settings into it's own file and struct.
* Re-add the time zone setting.
* Remove the clock settings from the Deskbar preference window, they
  are in Time now.
* Make Locale preferences accepts B_LOCALE_CHANGED message, although
  not used.
2012-12-20 18:31:42 -05:00
John Scipione 05fa08371f Indent the indented checkboxes in Deskbar prefs more.
* Create my own kIndentSpacing parameter from ControlLook which sets
  the indent spacing width to match the previously used spacing. This
  lines the indented checkbox up with the text of the unindented
  checkbox above it. This matches what it looked like before I
  updated the dialog to use font-aware spacing, while keeping the
  same relative spacing at different font sizes.
2012-04-18 00:20:15 -04:00
John Scipione f5be13ecc7 Remove time zone clock option and Time preferences button.
* Nobody thought time zone was a particularly useful option to have
  in the clock.
* You can still open Time preferences from Deskbar by right clicking
  on the clock, but, since there isn't a big connection between
  the clock settings in Deskbar and Time preferences anymore
  this button isn't needed here.
* There are still 2 clock options, Show seconds, and Show day of week
  and day of week is localized as well so this wasn't a total wash.
2012-04-17 23:38:12 -04:00
John Scipione 30a5580244 Remove Time Interval radio buttons from Deskbar Prefs.
* 12/24 hour clock is set from the Locale prefs only.
* Redirect B_LOCALE_CHANGED message to the replicant tray instead
  of the time view and tell the replicant tray to update the time
  instead of updating the time view directly. This is because there
  was a bug where if the AM/PM marker grew the time view over the
  replicant tray icons when switching from 24 hour to 12 hour clock
  it wouldn't reflow the replicant tray icons like it should.
* Rename the replicant tray view from "Status" to "_replicant_tray_"
  because BarApp uses FindView() to get the view by name and I'm
  assuming that this method can have conflicts. Following the example
  of the "_deskbar_tv_" naming convention.
2012-04-17 22:48:57 -04:00
Oliver Tappe 546208a539 More catalog-related cleanup.
* rename B_TRANSLATE_CONTEXT to B_TRANSLATION_CONTEXT and
  B_TRANSLATE_WITH_CONTEXT to B_TRANSLATE_CONTEXT, squashing a TODO
* adjust all uses of both macros in Haiku's source tree
* use correct header guard for collecting/Catalog.h

The renamed macros require adjustments to all external applications
using catalogs.
2012-04-16 21:31:22 +02:00
John Scipione c0611fac87 Convert Deskbar preferences to use font aware spacing. 2012-04-15 19:06:58 -04:00
John Scipione afe43d0a55 Now that StringViews are left-aligned
by default I don't have to set the size explicitly in the Deskbar Prefs Window.
2012-04-15 16:20:56 -04:00
John Scipione 083776f89f 2 small visual tweaks to Deskbar prefs
Push the icon size slider down 10px
Indent the time interval radio buttons over 10 more px (20px total)
2012-04-15 01:56:01 -04:00
John Scipione a81ab45891 Add a button to open Time preferences from Deskbar
preferences in the Clock section.
2012-04-15 01:45:05 -04:00
John Scipione 3cf2d117e5 Change Time Format Options in Deskbar preferences.
Added two new methods to the Locale Kit in order to create a custom time
formats from a format string. One method is outputs into a char* array,
the other into a BString() and you can set the timezone.

These methods should be cleaned up, we only need 2, one to get
the time in a predefined style, the other to get a custom time format.
Also should probably do the same for dates and datetimes. But I'll let
this go for now.

I added myself to the Locale.cpp file. I retained the copyright instead
of assigning it to Haiku, Inc. because the file is under the OpenBeOS
license and I don't know what the concequences of copyright sharing are
for that license, unlike MIT.

These new methods are used to generate custom time formats in Deskbar.
Instead of using a set of Radio Buttons to choose between the predefined
time options I build my own by creating a format string and passing it
to the Locale Kit. The format string is generated from 3 checkboxes,
show seconds, show day of week, and show time zone. You can mix and match
between them choose any that you like. By default they are all off.

There are 3 new deskbar settings associated with these new options:
showSeconds, showDayOfWeek, and showTimeZone. timeFormat has gone away.

The time format string gets cached and updated only when Update() gets called
on the TimeView class.

In order to fit all the options in (there is 1 more than before) I had to
reduce the font size of the clock to 11pt when all options are turned on in
12 hour mode. For those with no imagination it looks like this:

http://imagebin.org/208162

Renamed "Open time preferences..." menuitem to "Time preferences...".
Renamed "Show Time" and "Hide Time" to "Show time" and "Hide time".

Other changes include refactoring the header files a bit. There were a lot
of headers included by header files uneccessarily. For instance BarWindow.h
now only includes <Window.h> and <Deskbar.h>. This change is mainly to
to speed up the compile time since it takes a while right now.

I copy the fBarView pointer from BarWindow in the BarApp constructor and then
use that throughout the file rather than getting the pointer from the window
each time by calling BarView(). BarView() is still available in the header
for other classes though.

I moved some message constants around since it was getting a bit jumbled.
Most of the messages related to settings are in PreferenceWindow.h.
fChangeState is moved to BarView.h since that is where the ChangeState()
function is and BarView.cpp uses that constant.

The time interval and format constants are in TimeView.h.

Make some methods public in their respective classes where it made sense.
The preference window methods to update dependent items are public, that
might get called from BarWindow when a message gets received at some point.

Also made ShowHideTime() and Time() public in StatusView.h. These methods
activate showing and hiding the clock and return the fTime clock object.
No reason they should be private.

I reindented the StatusView.h and PreferenceWindow.h headers to the standard
style. Question here, are the public: protected: and private: lines inside
of classes suppose to get indented 1 tab or not? I've seen both, the style
guide says no indent but 1 indent seems reasonable and looks pretty good.

Style fixes here and there. That's enough for one commit I think.
2012-04-15 00:17:54 -04:00
John Scipione d187a1ef55 Put 'Hide application names' checkbox before Icon Size slider in Desbkar Preferences. 2012-04-11 03:06:10 -04:00
John Scipione 95e02d4972 Remove superfluous colons 2012-04-10 01:36:42 -04:00
John Scipione 573f748c5f Add 12/24 hour and time formatting options to Deskbar.
* 12/24 hour settings come from and alter BLocale
* Time formats are short, medium, long. Short is default. Come from
  Locale kit.
* Don't delete fClock (now fTime) when hiding, just hide and show
  the view.
* BarView now has nothing to do with setting or keeping track of
  time settings. This is all handled in TTimeView. TReplicantTray
  is responsible for updating the replicant tray and doing showing
  and hiding. TTimeView is responsible for drawing according to the
  clock settings.
* Remove fShowInterval and fShowSeconds from BarView
* Remove ampmMode setting and replace it with timeFormat.
* Reset targets in DeskbarMenu.

Originally I was trying to solve a bug where the TTimeView
was relying on the Deskbar settings too much. The settings
should only by set on quit and accessed on startup or a crash can
cause Deskbar to be in an unusual state.

I realize that the timezone is not very helpful. I'd like to provide
the day of week in a short format instead, i.e. Wed for Wednesday or
similar based on your locale. Blame the Locale Kit for now allowing
me to be able to use a custom TimeFormat. Once a custom TimeFormats
becomes possible from the Locale Kit Deskbar can be updated to use
them.
2012-04-10 01:28:22 -04:00