Skip to content

Commit c90e4f0

Browse files
committed
added basic layout documentation #1
1 parent b897fac commit c90e4f0

File tree

2 files changed

+113
-0
lines changed

2 files changed

+113
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# Stack
2+
23
Public [Bug/Feature tracker](https://github.com/losttech/Stack/issues) for [Stack](https://losttech.software/stack.html) window manager
34

45
![broken window image](https://raw.githubusercontent.com/losttech/Stack/master/Broken_Window.jpg)
6+
7+
## See also
8+
9+
Documentation on [making new layouts](docs/layouts/README.md)

docs/layouts/README.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Stack: Introduction into screen layouts
2+
3+
Stack uses [XAML](https://docs.microsoft.com/en-us/dotnet/desktop-wpf/fundamentals/xaml)
4+
for screen layouts. It is a technology, that Microsoft
5+
developed to define user interfaces in 2010.
6+
7+
## Concepts
8+
9+
Stack is build around screen **layouts**. **Layout** is a text file, that
10+
defines how to cut screen into pieces, and what should be in those pieces.
11+
12+
The most important thing you can put in a piece of a screen layout is a **Zone**.
13+
**Zone** is an area of the screen, where windows can be placed. Typically,
14+
every window fills the entire **Zone** it is added to, but you can also tell
15+
Stack to stack windows in the **Zone** vertically or horizontally.
16+
17+
The [version of Stack sold in Windows Store](https://www.microsoft.com/en-us/p/stack-window-manager/9p4rj8rl7qgs) also supports **Tabs** element, which you can place anywhere on
18+
the screen, and it will display all the windows in a **Zone** or multiple zones
19+
like the browser tabs do.
20+
21+
In addition to that you can place many other stuff on your desktop via
22+
a **layout**, like images, videos, or even simple
23+
[3D scenes](https://docs.microsoft.com/en-us/dotnet/framework/wpf/graphics-multimedia/how-to-create-a-3-d-scene). Windows Store version also provides widgets and
24+
various ways to display data from the Internet. See more information in
25+
[widgets documentation](https://github.com/losttech/Stack.Widgets/blob/master/README.md).
26+
27+
## Basic layout
28+
29+
We recommend [WPF Tutorial](https://www.wpftutorial.net/LayoutProperties.html)
30+
to get basics about how can you divide screen into parts, and put zones into
31+
them. Start with one of the out of box layouts to get a hang of how things work
32+
in practice (remember to make a copy: all out of box layouts are overwritten
33+
after each app update!).
34+
35+
## Zones
36+
37+
This is an example of a **Zone** in a **layout**:
38+
39+
```XML
40+
<zones:Zone x:Name="LargeZone" Id="MyLargeZone"/>
41+
```
42+
43+
### Zone overlapping
44+
45+
Zones in Stack can overlap arbitrarily. A common scenario is to have a large
46+
**Zone**, that has two or more *subzones*. When you drag a window around, you
47+
want to be able to place it in either one of the subzones, or in the large
48+
**Zone**.
49+
50+
In order to achieve that, out of box layouts typically put the large
51+
**Zone** on the screen first, and then cover it with subzones. That way you can
52+
easily drop the window in one of the subzones.
53+
54+
To be able to drop a window in the large **Zone** however, one has to define
55+
some area above the subzones, so that if you leave the window there, it will
56+
expand to the large **Zone**. You can do that in your layout by creating a
57+
**drop Zone**, and setting its `Target` to the large **Zone** like this:
58+
59+
```XML
60+
<zones:Zone x:Name="MyDropZone"
61+
Target="{Binding ElementName=LargeZone}"/>
62+
```
63+
64+
When you drop your windows on `MyDropZone` they will end up on `LargeZone`
65+
instead.
66+
67+
## Tabs
68+
69+
Tabs display can be placed anywhere in the layout, and show list of all windows in
70+
a zone or multiple zones. You can have many tab displays on your layout, and
71+
the same different tab lists can show the same window if necessary.
72+
73+
![Tabs demo](https://losttech.software/img/Stack-Tabs.gif)
74+
75+
When adding tabs to the layout, you just need to specify the source for the list
76+
of windows via `ItemsSource` like this:
77+
78+
```xml
79+
<zones:WindowTabs VisibilityCondition="AlwaysVisible"
80+
ItemsSource="{Binding Windows, Source={x:Reference YourZoneName}}" />
81+
```
82+
83+
Here, `VisibilityCondition` can have one of the following values:
84+
85+
- **MultipleItems** (default) - only appear when there are multiple windows.
86+
- AlwaysVisible - tabs are always visible (and take screen space).
87+
- OneItem - tabs appear only when there's at least one window open.
88+
89+
## Dynamic layout: data binding and triggers
90+
91+
XAML, the language of Stack layouts, permits [**data binding**](https://docs.microsoft.com/en-us/dotnet/desktop-wpf/data/data-binding-overview) and [**triggers**](https://www.wpf-tutorial.com/styles/trigger-datatrigger-event-trigger/).
92+
That means, that you can tell layout elements to change how they look like
93+
depending on some conditions, like number of windows open, which one
94+
is active, where your mouse is, etc. You can even use external conditions,
95+
like your local weather or current price of some stock through our
96+
[widgets library](https://github.com/losttech/Stack.Widgets/blob/master/README.md).
97+
98+
For the list of things, that you can bind to in Stack (in addition to the
99+
standard things in XAML), check out [Data you can bind to](DataToBind.md).
100+
101+
## Extras
102+
103+
Please, see [What's New](https://losttech.software/stack-whatsnew.html) for the
104+
extra features, that have been added recently, and might not have been
105+
described here.
106+
107+
Also, check out [our blog](http://stack.blogs.losttech.software/) for some cool
108+
stuff we made using Stack layouts.

0 commit comments

Comments
 (0)