Commit Graph

126 Commits

Author SHA1 Message Date
Stephan Aßmus
b46615c55a Applied patch by Joseph "looncraz" Groover from ticket #7445.
This changes how Decorators are managed and applied. The app_server
no longer scans and maintains the available ones himself, but is
simply asked to load a Decorator add-on from a provided path.
The Decorator scanning is moved into DecorInfo and DecorInfoUtil,
private classes in the InterfaceKit. The bin command 'setdecor'
uses those.
I cleaned up all the coding style violations that I could find,
removed chunks of code which didn't make sense (if you never put
a NULL pointer into a list, you don't need to check for this and
so on) and also cleaned up other passages for improved clarity
and simplicity.
I also tested the functionality and it works fine. Would even be
Ok to include in Alpha 3, IMHO. Thanks for the patch!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41581 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-19 15:25:54 +00:00
Clemens Zeidler
13a19d84df Fix #7181. The active set solver can only handle positive values and the offset was not added everywhere.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40497 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-02-14 21:45:44 +00:00
Clemens Zeidler
5ba9397df3 Change S&T to make it work with the new solver. It also still works with lp_solve.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40286 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-25 05:02:32 +00:00
Clemens Zeidler
1cbfd712a3 Fix #7017 and hopefully #7001. WindowArea is not valid any more when splitting a group. Fix debug assert.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40058 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-02 00:19:36 +00:00
Clemens Zeidler
f108cdbfab Merge all linear programming types in one file an rename them.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39832 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-13 19:23:33 +00:00
Clemens Zeidler
5440f6fee3 Refactor the linear programming class to use a minimal solver interface class and implement the interface for lp_solve. As a result lp_solve is not visible to the outside any more. This interface could be used to use other solvers as well. Rename operator constants to no clash with lp_solve constants.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39829 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-13 18:41:58 +00:00
Clemens Zeidler
6f61f09f4d Move S&T group switching shortcut to cmd + option + arrow up/down.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39773 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-08 22:25:44 +00:00
Clemens Zeidler
83cdf43f09 - Give the option for the desktop listener to "absorb" key events.
- Make the S&T groups navigateable by pressing the S&T key + arrow down/up. Arrow down means to send the active S&T group to the bottom. Arrow up means to rise the bottom S&T group to the front. If no S&T group is selected, in both cases the front-most S&T group is activated.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39751 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-06 23:15:15 +00:00
Clemens Zeidler
d8db8216de Correctly check if the mouse has been on the tab.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39750 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-06 19:31:11 +00:00
Clemens Zeidler
fd5a5935a7 As suggested by Jérôme remove one level of indentation.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39745 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-05 19:33:16 +00:00
Clemens Zeidler
b7a1df8004 Using the darken highlight colour approach.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39714 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-03 04:01:21 +00:00
Clemens Zeidler
f149f7aa88 If a window is removed from a group by the user make sure that the window is under the mouse cursor.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39713 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-03 02:29:13 +00:00
Clemens Zeidler
946c6e2d9a Just a very slight improvement of the S&T highlight colour. Change it from red to a more descent greenish. Think the border colour is acceptable but the highlighted tab still looks awful. Feel free to improve it!
By the way, is there a pattern how to select the colours?



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39708 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-02 21:05:46 +00:00
Clemens Zeidler
ac701f7e7b Only highlight the adjacent borders when tile them.
Simplify Decorator highlighting code. Thanks Ingo for the hard part done in the previous highlight changes!



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39702 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-02 02:33:36 +00:00
Clemens Zeidler
b108306f59 Only allow to S&T window with a normal window feel. This behaviour makes S&T more consistent e.g. floating windows suddenly disappeared from the S&T group when the subset window was inactive.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39688 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-01 02:58:40 +00:00
Ingo Weinhold
2b602c7364 * Decorator:
- Added ExtendDirtyRegion(), given a decorator region it extends the given
    dirty region. Implemented only in DefaultDecorator yet.
  - Added [Set]RegionHighlight() which allows to set/get a highlight for a
    decorator region. The visual representation of the set highlight value
    is up to the derived classes. The only globally defined value is
    HIGHLIGHT_RESIZE_BORDER, though it's not implemented anywhere yet.
* DefaultDecorator: Added the highlight for the component as a parameter to
  GetComponentColors(). Added a wrapper _GetComponentColors() with the old
  interface, fetching the highlight from the base class.
* SATDecorator: Defines and interprets its own highlight value
  HIGHLIGHT_STACK_AND_TILE.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39640 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-26 01:03:27 +00:00
Ingo Weinhold
06aa76e216 DefaultDecorator(/SATDecorator):
* Use a separate color array for the buttons, instead of using that for the
  tab.
* _DrawBlendedRect(): No longer gets the focus flag, but gets a color array
  instead.
* _GetBitmapForButton(): Made non-static and removed the "focus" and "object"
  parameters.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39637 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-25 23:23:08 +00:00
Ingo Weinhold
09b19da8c2 Introduced enum DefaultDecorator::Component to refer to the components of the
default decorator and used it instead of Decorator::Region where appropriate
(GetComponentColors(), _GetBitmapForButton()).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39636 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-25 22:42:21 +00:00
Ingo Weinhold
ad1100115a Don't use the border highlight colors for the tab frame.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39635 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-25 22:32:37 +00:00
Ingo Weinhold
e3ab8648d1 * DefaultDecorator:
- Introduced a virtual GetComponentColors(), that returns an array with the
    current colors for the specified component.
  - Removed all rgb_color members. Replaced the ones that were actually
    constant by const (or static const) ones and made use of
    GetComponentColors() where the non-constant ones were used.
* SATDecorator:
  - Turned rgb_color members into constants and added an overriding version
    of GetComponentColors().
  - HighlightBorders(): Invalidate the tab, too, as we use the border
    colors for drawing the outer lines of the tab (was this intented?).
    Fixes artifacts when breaking apart titled windows.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39630 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-25 20:07:32 +00:00
Ingo Weinhold
7ca71ab6a2 * DefaultDecorator: Moved the button drawing from _DrawTab() to the new
virtual DrawButtons().
* SATDecorator: Override DrawButtons() instead of _DrawTab(), thus saving a
  good deal of code duplication.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39627 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-25 15:01:30 +00:00
Ingo Weinhold
638d9c8039 * Coding style cleanup.
* Made inline getters in SATDecorator const.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39626 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-25 14:42:28 +00:00
Ingo Weinhold
b509dbd998 Removed unused _SetColors().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39619 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-24 23:17:31 +00:00
Rene Gollent
7330d2fae3 Looks like this was somehow missed in r39602. Fixes build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39603 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-24 03:20:09 +00:00
Ingo Weinhold
89d652d5e0 * Decorator: Replaced the MouseAction() method with a new RegionAt().
RegionAt() just gets a point and returns which region was hit. This is in
  order to move behavioral code to [Default]WindowBehaviour. I'm not happy
  with this solution either, but to do it properly one would have to break the
  Decorator interface into separate look and feel interfaces and reorganize the
  interaction with WindowBehaviour. A task for the so-inclined reader. :-)
* Adjusted the Decorators implementations, but really tested only the default
  one.
* DefaultWindowBehaviour:
  - Replaced _ActionFor() method by a _RegionFor() which interprets the region
    returned by Decorator::RegionAt() and converts it to a "functional" region,
    i.e. combines cases we handle the same way.
  - MouseDown():
    - Handle the click region cases more in detail, disentangling the mouse
      button cases. With the following effects:
      - The middle mouse button has no effect anymore.
      - Left and right mouse buttons no longer share common behavior. A right
        click on a decorator button will send the window to the back.
    - The window key window management modifier combo does now have precedence,
      i.e. Cmd-Ctrl-click on the decorator buttons will have the same effect as
      clicking anywhere in the window.
    - When modifiers change between the clicks, reset the click count. Prevents
      a standard click in the window followed by a Cmd-Ctrl-click from being
      recognized as a double-click.
  - Mouse*(): Introduced a fMinimizeCheckOnMouseUp which works similar to
    fActivateOnMouseUp, just for double-clicks. The decision whether a
    double-click minimizes the window is postponed until releasing the mouse
    button. After moving the mouse sufficiently far or waiting half a second
    without moving the mouse the window will no longer be minimized. Fixes
    #6868.
  - MouseUp(): Moved the primary mouse button check without the
    "decorator != NULL" block. I suppose this fixes issues with the Cmd-Ctrl
    actions and decoratorless windows (if those actually exist).

I can't wait to hear what things I've broken. :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39602 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-24 02:09:50 +00:00
Clemens Zeidler
2aa6775158 Fix restoring of stacked windows.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39535 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-20 07:07:32 +00:00
Clemens Zeidler
9ff327dea3 - Make MessageForListener a bit more flexible, passing a fix ServerLink is sometimes not enough and a separate sender and receiver is needed.
- Add communication part to restore and save S&T groups.
- Fix call of GetDecoratorSettings listener hook.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39534 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-20 06:47:20 +00:00
Clemens Zeidler
f72d191b12 - If there is no SATWindow because of lack of memory try to create a SATWindow when asking for it.
- Add untested code to save a SATGroup and to restore a SATGroup.
- Splitting of a SATGroup is now triggered from the WindowArea destructor. This make it easier to restore S&T groups when windows in a group are missing. A group decays automatically in multiple groups when the missing window connected multiple windows.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39461 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-17 03:06:09 +00:00
Axel Dörfler
55a54abc90 * Fixed build.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39437 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-15 18:31:21 +00:00
Clemens Zeidler
f1c707c4a2 - Fix a TODO: get the border width and tab height directly from the decorator and don't use hard coded values. For example, you can tile tab less windows probably together now.
- Only use min size constraints now. If there is a clash between a window with a max size and another window with a min size the max size is ignored and the size is enlarged if needed. When removing this window from a S&T group the old size limit is restored.
Same is done for none resizeable windows.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39432 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-15 02:54:15 +00:00
Clemens Zeidler
0fd274fa57 The new app-server double click detection has broke minimization in S&T. React only on single clicks now, fix #6759.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39182 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-29 08:33:47 +00:00
Clemens Zeidler
934c820ce8 Include resize area for S&T operations.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39005 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-18 16:08:46 +00:00
Clemens Zeidler
07a8c14656 Only allow stacking if the candidate window is dragged using the window tab.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39004 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-18 15:49:14 +00:00
Clemens Zeidler
007179caca Use the mouse x position and the candidate tab top when searching for a stacking parent. I think this makes the stacking detection more intuitive.
The candidate window is the dragged window and the parent window is the window that accept the SAT operation.
  


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39003 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-18 15:40:44 +00:00
Clemens Zeidler
975a7dd89d Make the stacked tab length a bit bigger and only cut the string at the end if the tab becomes small.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38907 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-09 20:57:15 +00:00
Clemens Zeidler
c26897652c Use the static linprog lib.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38887 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-04 20:18:45 +00:00
Clemens Zeidler
a2336b86cc Round the the window move target positions, this should fix jumping windows.
Coding style.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38789 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-09-22 22:27:31 +00:00
Clemens Zeidler
7306ba0448 Watch the window look and remove a window from a S&T group if the look changed to B_NO_BORDER_WINDOW_LOOK.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38731 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-09-19 21:46:42 +00:00
Clemens Zeidler
3ae8f84c3d Better check if the area exist.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38730 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-09-19 21:41:53 +00:00
Clemens Zeidler
e0c538ed7d A decorator can change during the lifetime of a window so get a fresh decorator every time.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38729 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-09-19 21:08:47 +00:00
Clemens Zeidler
a4dab27fab Fix crash #6615 and #6566.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38728 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-09-19 20:54:06 +00:00
Clemens Zeidler
cc4f4ca5f8 Don't try to split a group if there is still a window stacked in a WindowArea.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38727 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-09-19 20:25:29 +00:00
Clemens Zeidler
6f4b6e915b Also change it in S&T.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38726 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-09-19 20:24:19 +00:00
Rene Gollent
4f9892e0f8 Build fix.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38692 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-09-17 18:21:54 +00:00
Clemens Zeidler
d256161aec Calculate a better size limit in a stacking group.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38683 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-09-17 05:46:13 +00:00
Clemens Zeidler
dcbc4af5d1 - Add size limit changes to the listener interface.
- Update size limit constraints in S&T only if necessary.
- Header style fixes.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38682 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-09-17 04:04:02 +00:00
Clemens Zeidler
d2cf4da51f Fix min/max size calculation.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38681 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-09-17 01:10:13 +00:00
Clemens Zeidler
5733bbb94b If the constraints are infeasible don't move the windows because the target positions are not valid. Partially fix #6631.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38680 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-09-16 22:02:17 +00:00
Clemens Zeidler
caefa86759 Fix highlighting of the tiling parents.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38657 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-09-15 05:24:54 +00:00
Clemens Zeidler
727c8ba2c9 Improve min constraints and add max constraints, not perfect yet but much better then before.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38643 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-09-14 05:23:05 +00:00