History log of /haiku/src/kits/tracker/ViewState.h
Revision Date Author Comments
# 054c1b27 31-Aug-2022 Augustin Cavalier <waddlesplash@gmail.com>

Tracker: Overhaul list column size initialization and storage.

Mostly for HiDPI, but this also cleans up the code in general, too.

* Apply a scale-factor when loading and serializing column size/offsets
in ViewState.

* Do not hard-code offset values for default columns but let
BPoseView::AddColumn() compute them manually instead.

* Change BPoseView::AddColumn() to support being called during
early initialization and utilize it in SetUpDefaultColumns...().

* When adding deserialized columns to a BPoseView, always realign
the offsets instead of just doing sanity checking. The rationale here
is that the first time the TitleView is touched, it will do this
anyway, and cause "snapping" or drawing glitches if the alignment
is not as expected.

If it was actually somehow an intended feature that non-adjacent
columns can be displayed, changes are needed in TitleView and PoseView
to properly support this without triggering redraw glitches.

I still saw some very slight redraw glitches (e.g. column contents
shifting by 1px) at higher font sizes; however, Tracker before this
commit had far more of those glitches (this commit seems to resolve
a number of them.)

Tested with 12pt, 18pt, and 20pt font sizes; this seems to work
pretty well. But if you see strange behavior or more redraw glitches
than there were previously, please do file a ticket.


# 3f377da0 14-Jul-2022 Jim906 <jim_l@fastmail.com>

BFilePanel: save state less often

* Change BContainerWindow::fStateNeedsSaving from private to
protected, so that TFilePanel functions can set it to false, like
the analagous BContainerWindow functions do.
* Prevent fStateNeedsSaving from being set to true because of a change
to window size/position, unless the window is active. This is
meant to distinguish changes made during object setup from changes
made by the user.
* Add more calls to ViewState::_StorePrevious state.
BContainer::fPoseView triggers saving on some occasions because its
member fViewState needs to save. fViewState needs saving when there
are mismatches between pairs of f[x] and fPrevious[x], e.g. fIconSize and
fPreviousIconSize. These mismatches can arise when the ViewState
is set up. These pairs are synchonized by _StorePreviousState.
* Rearrange the modified ViewState functions to keep the 'const'
modifier on the existing code.
* Fixes #17374.

Change-Id: I2a6c1c1d9c5c3656eab2ebc770a5915010e7500c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5447
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>


# 3557a902 22-Jul-2014 John Scipione <jscipione@gmail.com>

Tracker: style fixes, whitespace only


# 27dc6eb7 20-Jun-2014 John Scipione <jscipione@gmail.com>

Tracker: style fixes to ViewState


# db416834 02-Jan-2013 Matt Madia <mattmadia@gmail.com>

Automatic whitespace cleanup. No functional change.


# ea001e58 28-Jul-2012 John Scipione <jscipione@gmail.com>

Round 2 of style changes to Tracker

* focused on 80-char limit fixes.
* also some whitespace and case statement indentation fixes


# b05aa8b5 27-Jul-2012 John Scipione <jscipione@gmail.com>

Style changes in Tracker, no functional change.

Manual whitespace cleanup
Change instances of const char * to const char*
Convert /* */ C style comments to // C++ style comments


# b64b6705 24-Apr-2010 Rene Gollent <anevilyak@gmail.com>

Factored out initialization of default values into an _Init() function that's now called by all constructors.
The BMessage version of the ViewState constructor was not retrieving the icon/last icon size values.

May fix #4322.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36455 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e70b6d95 06-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

* Cleanup in the icon mode stuff. kScaleIconMode is gone. There is simply
kIconMode and it can have different sizes.
* The "Icon Mode" super menu item is marked, when in icon mode, as well as
the size item in it's sub menu.
* When switching from mini icon mode or list mode back into icon mode, the
previous icon size is now restored. This also works when the folder has
been closed meanwhile. (The on-disk format for view state has changed, so
your folders will open with default values.)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29971 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e85ca56c 17-Oct-2008 Alexandre Deckner <alex@zappotek.com>

* Style cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28209 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3d7584da 16-Oct-2008 Alexandre Deckner <alex@zappotek.com>

* Rewrote the way BViewState checks if changes needs to be saved on quiting a navigation window (icon mode and
list mode) or switching dir in single window navigation. Fixes the other half of the problem in #2441. Left some
todos.
I discovered an other bug that can add a random offset after finishing adding poses.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28205 a95241bf-73f2-0310-859d-f6bbb57e9c96


# eeb608e1 26-Jun-2007 Axel Dörfler <axeld@pinc-software.de>

* StringFromStream() did not work correctly for empty strings (messed up the stream
position).
* StringFromStream() called BString::LockBuffer() with "length", but touched "length + 1"
bytes.
* Prepared for the new "display as" FileTypes feature.
* The "DefaultQueryTemplate" folder now adds the MIME type of the folder to the
attribute menu for simplified editing (before, you had to move a file with a
matching file type into that folder to be able to add the attributes you likely
wanted to see).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21509 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f974492c 04-Oct-2006 Axel Dörfler <axeld@pinc-software.de>

Imported ViewState.cpp|h 1.2 from OpenTracker CVS.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18996 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7fb6186f 29-Aug-2006 Stephan Aßmus <superstippi@gmx.de>

* integration of vector icons with the registrar and the mime data base
* additional versions of SetIcon[ForType] and GetIcon[ForType] in BMimeType
and BAppFileInfo, which handle flat vector icon data
* changes in Tracker to support scalable icons (currently broken for
non-vector icons and needs cleanup) and drawing icons correctly with alpha
channel (large parts of this work done by Michael Lotz)

If someone feels like looking over the changes, that would be much
appreciated! :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18699 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 02be5353 22-May-2005 Axel Dörfler <axeld@pinc-software.de>

Added libtracker.so to the repository and the build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12772 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3557a902709efed6b7dcd7337fb9768130ac7d49 22-Jul-2014 John Scipione <jscipione@gmail.com>

Tracker: style fixes, whitespace only


# 27dc6eb7e154920329b9f6c9f84c338c5571ebed 20-Jun-2014 John Scipione <jscipione@gmail.com>

Tracker: style fixes to ViewState


# db41683495bfde817554415d14ae6f9cc91e77eb 02-Jan-2013 Matt Madia <mattmadia@gmail.com>

Automatic whitespace cleanup. No functional change.


# ea001e585a588e40404945a1201821da893d2e09 28-Jul-2012 John Scipione <jscipione@gmail.com>

Round 2 of style changes to Tracker

* focused on 80-char limit fixes.
* also some whitespace and case statement indentation fixes


# b05aa8b5b16e5b4f420a35c37805c6387df98737 27-Jul-2012 John Scipione <jscipione@gmail.com>

Style changes in Tracker, no functional change.

Manual whitespace cleanup
Change instances of const char * to const char*
Convert /* */ C style comments to // C++ style comments


# b64b6705ad7f2770f909d4096de68b371454545c 24-Apr-2010 Rene Gollent <anevilyak@gmail.com>

Factored out initialization of default values into an _Init() function that's now called by all constructors.
The BMessage version of the ViewState constructor was not retrieving the icon/last icon size values.

May fix #4322.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36455 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e70b6d957a03fbd24b6c47ad2668d23c11806912 06-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

* Cleanup in the icon mode stuff. kScaleIconMode is gone. There is simply
kIconMode and it can have different sizes.
* The "Icon Mode" super menu item is marked, when in icon mode, as well as
the size item in it's sub menu.
* When switching from mini icon mode or list mode back into icon mode, the
previous icon size is now restored. This also works when the folder has
been closed meanwhile. (The on-disk format for view state has changed, so
your folders will open with default values.)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29971 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e85ca56c7d260437cd5ac4cc9947ba8b2af503c3 17-Oct-2008 Alexandre Deckner <alex@zappotek.com>

* Style cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28209 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3d7584da5c52a15f7219fd8527a5dd08353d45a3 16-Oct-2008 Alexandre Deckner <alex@zappotek.com>

* Rewrote the way BViewState checks if changes needs to be saved on quiting a navigation window (icon mode and
list mode) or switching dir in single window navigation. Fixes the other half of the problem in #2441. Left some
todos.
I discovered an other bug that can add a random offset after finishing adding poses.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28205 a95241bf-73f2-0310-859d-f6bbb57e9c96


# eeb608e1c7a4655b1e15f3333b9b3f7ef5a83795 26-Jun-2007 Axel Dörfler <axeld@pinc-software.de>

* StringFromStream() did not work correctly for empty strings (messed up the stream
position).
* StringFromStream() called BString::LockBuffer() with "length", but touched "length + 1"
bytes.
* Prepared for the new "display as" FileTypes feature.
* The "DefaultQueryTemplate" folder now adds the MIME type of the folder to the
attribute menu for simplified editing (before, you had to move a file with a
matching file type into that folder to be able to add the attributes you likely
wanted to see).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21509 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f974492c2d7f3f4b827fb84bb3c02512c92aa4f7 04-Oct-2006 Axel Dörfler <axeld@pinc-software.de>

Imported ViewState.cpp|h 1.2 from OpenTracker CVS.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18996 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7fb6186f3cb93a14ea0f96a82bdfc3d18f3ad56e 29-Aug-2006 Stephan Aßmus <superstippi@gmx.de>

* integration of vector icons with the registrar and the mime data base
* additional versions of SetIcon[ForType] and GetIcon[ForType] in BMimeType
and BAppFileInfo, which handle flat vector icon data
* changes in Tracker to support scalable icons (currently broken for
non-vector icons and needs cleanup) and drawing icons correctly with alpha
channel (large parts of this work done by Michael Lotz)

If someone feels like looking over the changes, that would be much
appreciated! :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18699 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 02be5353fd41ea40007a382e13f007eaf6b5a3a0 22-May-2005 Axel Dörfler <axeld@pinc-software.de>

Added libtracker.so to the repository and the build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12772 a95241bf-73f2-0310-859d-f6bbb57e9c96