If you have no apps open because Tracker crashed and you opened a new team it
would size the expando menu bar incorrectly in vertical mode.
This fixes the problem.
Let me tell you a story about a bug.
In a615ec8f86 Axel imported the OpenTracker code
into Haiku with fSaveStateIsEnabled set to true (for Desktop and all windows).
In 9f2a3f6f47 I (John) changed it to:
fSaveStateIsEnabled(dynamic_cast<BDeskWindow*>(this) == NULL) which is suppose
to detect whether or not the ContainerWindow is the Desktop and only save the
state if it is NOT. However, this didn't actually work because since this is
called in the constructor the dynamic_cast to BDeskWindow* fails. Therefore we
were still saving the state of Desktop even though the code make it look like
we weren't.
In e7803cf1f6 Augustin updated the code so that
BDeskWindow passes in a isDeskbar flag as part of the constructor parameters
thus detecting that the window was Deskbar correctly. So basically Augustin
fixed the bug detecting whether or not the window was the Deskbar in the
constructor which then disabled saving the Desktop's state to attributes.
Augustin unknowingly turned saving the Desktop's state off.
We don't want to disable saving the Desktop's state because that's where we
store things like the icon size. What I was probably thinking when I tried
unsuccessfully to turn off saving the state of the Desktop was that I don't
want to save the WINDOW state of the Desktop since that would save the
window dimensions of the Desktop (whatever your screen resolution is) and if
you changed Tracker to non-spatial mode and opened the Desktop in a Tracker
window it would pick up those attributes and then make the window take up the
entire dimensions of your screen (a whole different bug).
This bug, however, is also handled in 9f2a3f6f47
because code was added to BContainerWindow::SaveWindowState() which detects
whether or not the window is the Desktop and if so, doesn't save (or restore)
the window state (which is only part of the state).
So with this change (reversal really) the other parts of the Desktop's state
like icon size are once again saved while the window state is not.
Fixes#11864
Replace calls to dynamic_cast<BDeskWindow*>(this) != NULL with fIsDesktop
which is the flag added to the constructor in
e7803cf1f6.
We no longer need to do the expensive dynamic_cast's because we have a handy
flag to check instead.
We must toggle the expanded state of new windows if we are in
VERTICAL expando mode with Expand New Teams on.
The vertical part of the check got dropped accidentally in hrev48817
Thanks jstressman for reporting.
Fixes#11865
This is all work in progress. The plan is to move the code that does any
actual changes to the TextDocument into UndoableEdit implementations, then
emit these edits to interesed listeners. They can then store them to
implement the edit history. If there are not listeners, the edits will
simply be released after they've done their work.
Implemented so far is only the support for storing the edit listeners.
font.
The minimal haiku image does not yet include a monospace font. In that
case, be_fixed_font points to Bitstream Charter, which is a proportional
font.
Terminal isn't happy with that, so we try harder and we look if a
full-and-half-fixed font is installed (which should be safe, since
we always include VL-Gothic. Fixes#11764 .
The truncation code was truncating window titles earlier than it should because
it was mistakenly leaving room for the expander arrows when it should only be
looking for those on team menu items, not window menu items.
Sorry for the regression.
and remove TExpandoMenuBar as a friend class to BMenu hack.
In Deskbar, call the newly added MenuPrivate::SetLayout() method instead.
This is a much cleaner way to implement this, thanks Stefano Ceccherini
for the tip!
... from TeamMenuItem and WindowMenuItem.
It was confusing having Name(), Label(), and TruncatedLabel().
Name() == Label() because Label() never changes, the displayed
Label stored in TruncatedLabel() in both TeamWindowItem and
WindowMenuItem (remember they both inherit from
TruncatableMenuItem so they get that for free). So Name() was
redundant, by getting rid of it there is just Label() and TruncatedLabel()
which is all we need!
And add a SetLabel() that sets the truncated label when the label gets set.
This will be useful so we can compare the truncated label to the normal label
to tell if the label is truncated or not.
* Create a new TTruncatableMenuItem class to store the truncated string
and share the label truncation code between TTeamMenuItem and
TWindowMenuItem. In the future more shared code may be added to
this class, if so, the class name may change.
* The TTeamMenuItem and TWindowMenuItem classes inherit from
TTruncatableMenuItem, which inherits from BMenuItem.
* Make sure to truncate the label before drawing it in all cases.
* Some other related refactoring.
Fixes#9507
* Increase kVPad to 2.0f in ExpandoMenuBar matching the
constant in WindowMenuItem
* Also replace a hardcoded instance of 4.0f with kVPad * 2
* Remove TTeamMenuItem::DrawContentLabel(), move code to DrawContent()
* Cleanup label truncation code in TTeamMenuItem, still needs work.
* Rename WindowMenuItem::FullTitle() to Name() matching TeamMenuItem
* Move the code to set all label related variables in SetLabel() in
TeamMenuItem
* Change WindowMenuItem::SetRequireUpdate() to take a bool parameter
* Make WindowMenuItem::Initialize() private and rename it to _Init()
* Rename WindowMenuItem::ExpandedItem() to SetExpanded()
* Truncate WindowMenuItem label like we are doing TeamMenuItem
* Rename all WindowMenuItem::Title* methods and variables to Label*
Add private BMenu::_SetMenuLayout() method. Set TExpandoMenuBar
as a friend class in BMenu to call this method. A little hacky,
but, this keeps SetMenuLayout() from being exposed as part of
the public API.
Don't destroy and rebuild the ExpandoMenuBar when switching from
horizontal to vertical mode. Instead build the TExpandoMenuBar
when the application starts and then switch it from B_ITEMS_IN_ROW
to B_ITEMS_IN_COLUMNS by using the newly added _SetMenuLayout()
method.
When we resize from vertical to horizontal, recalc the max
menu item widths, this resizes the application menu items so
that they take up the right amount of space.
Since we no longer destroy the menu bar we no longer have to
save whether menu items are expanded or not in a separate list.
Instead we can store that information in directly in
TExpandoMenuBar. This removes a lot of code.
Fixes#9350
* Add Icon() and SetIcon() methods.
* Remove HasLabel() and SetHasLabel() methods, ExpandoMenuBar now gets
this information from the settings file directly, rather than storing
and syncing this information with the TTeamMenuItem class.
* Move SetOverrideWidth(), SetOverrideHeight(), and
SetArrowDirection() implementations to header.
* You can now insert arbitrary text only if the following or previous
placeholder does not resolve to an empty value using the %<, %> and
%- placeholders.
* Additionally, any non-alpha numeric character between % and the
placeholder character will only be displayed if the placeholder does
not resolve to an empty value, too.
* All of this allows you to get rid of the extra space between
"Terminal" and ":" before the current path -- which is now the
default.