diff --git a/src/apps/workspaces/Workspaces.cpp b/src/apps/workspaces/Workspaces.cpp
index f92b580..ca58b3e 100644
a
|
b
|
static const uint32 kMsgToggleBorder = 'tgBd';
|
55 | 55 | static const uint32 kMsgToggleAutoRaise = 'tgAR'; |
56 | 56 | static const uint32 kMsgToggleAlwaysOnTop = 'tgAT'; |
57 | 57 | static const uint32 kMsgToggleLiveInDeskbar = 'tgDb'; |
58 | | |
| 58 | static const uint32 kMsgWorkspaceLayoutChanged = 'wslc'; //From Screen preflet |
59 | 59 | |
60 | 60 | extern "C" _EXPORT BView* instantiate_deskbar_item(); |
61 | 61 | |
… |
… |
class WorkspacesApp : public BApplication {
|
156 | 156 | |
157 | 157 | virtual void AboutRequested(); |
158 | 158 | virtual void ArgvReceived(int32 argc, char **argv); |
| 159 | virtual void MessageReceived(BMessage *message); |
159 | 160 | virtual void ReadyToRun(); |
160 | 161 | |
161 | 162 | void Usage(const char *programName); |
… |
… |
WorkspacesWindow::Zoom(BPoint origin, float width, float height)
|
757 | 758 | height = floor(workspaceHeight * rows); |
758 | 759 | |
759 | 760 | while (width + 2 * GetScreenBorderOffset() > screenWidth |
760 | | || height + 2 * GetScreenBorderOffset() + GetTabHeight() > screenHeight) { |
| 761 | || height + 2 * GetScreenBorderOffset() + GetTabHeight() > screenHeight) { |
761 | 762 | width = floor(0.95 * width); |
762 | 763 | height = floor(0.95 * height); |
763 | 764 | } |
764 | 765 | |
765 | 766 | ResizeTo(width, height); |
766 | | |
767 | | origin = screen.Frame().RightBottom(); |
768 | | origin.x -= GetScreenBorderOffset() + width; |
769 | | origin.y -= GetScreenBorderOffset() + height; |
770 | | |
771 | | MoveTo(origin); |
772 | 767 | } |
773 | 768 | |
774 | 769 | |
… |
… |
WorkspacesWindow::MessageReceived(BMessage *message)
|
859 | 854 | break; |
860 | 855 | } |
861 | 856 | |
| 857 | case kMsgWorkspaceLayoutChanged: |
| 858 | { |
| 859 | float width = Frame().right - Frame().left; |
| 860 | float height = Frame().bottom - Frame().top; |
| 861 | Zoom(BPoint(0,0), width, height); |
| 862 | break; |
| 863 | } |
| 864 | |
862 | 865 | default: |
863 | 866 | BWindow::MessageReceived(message); |
864 | 867 | break; |
… |
… |
WorkspacesApp::ReadyToRun()
|
1029 | 1032 | fWindow->Show(); |
1030 | 1033 | } |
1031 | 1034 | |
| 1035 | void |
| 1036 | WorkspacesApp::MessageReceived(BMessage *message) |
| 1037 | { |
| 1038 | switch (message->what) { |
| 1039 | case kMsgWorkspaceLayoutChanged: |
| 1040 | { |
| 1041 | fWindow->MessageReceived(message); |
| 1042 | break; |
| 1043 | } |
| 1044 | default: |
| 1045 | BApplication::MessageReceived(message); |
| 1046 | break; |
| 1047 | }; |
| 1048 | } |
1032 | 1049 | |
1033 | 1050 | // #pragma mark - |
1034 | 1051 | |
1035 | | |
1036 | 1052 | int |
1037 | 1053 | main(int argc, char **argv) |
1038 | 1054 | { |
diff --git a/src/preferences/screen/Constants.h b/src/preferences/screen/Constants.h
index 3191d9d..6183d0b 100644
a
|
b
|
static const uint32 kMsgWorkspaceRowsChanged = 'wsrc';
|
43 | 43 | |
44 | 44 | // Constants |
45 | 45 | extern const char* kBackgroundsSignature; |
| 46 | extern const char* kWorkspacesSignature; |
46 | 47 | |
47 | 48 | static const int32 gMinRefresh = 45; // This is the minimum selectable refresh |
48 | 49 | static const int32 gMaxRefresh = 140; // This is the maximum selectable refresh |
diff --git a/src/preferences/screen/ScreenWindow.cpp b/src/preferences/screen/ScreenWindow.cpp
index 335f70d..61f4c9c 100644
a
|
b
|
|
67 | 67 | |
68 | 68 | |
69 | 69 | const char* kBackgroundsSignature = "application/x-vnd.Haiku-Backgrounds"; |
| 70 | const char* kWorkspacesSignature = "application/x-vnd.Be-WORK"; |
70 | 71 | |
71 | 72 | // list of officially supported colour spaces |
72 | 73 | static const struct { |
… |
… |
ScreenWindow::_UpdateWorkspaceButtons()
|
827 | 828 | _GetColumnRowButton(false, true)->SetEnabled(columns * (rows + 1) < 32); |
828 | 829 | } |
829 | 830 | |
| 831 | void |
| 832 | ScreenWindow::_UpdateWorkspaceWindow() |
| 833 | { |
| 834 | BMessage msg(kMsgWorkspaceLayoutChanged); //Workspace Layout Changed |
| 835 | BMessenger messenger(kWorkspacesSignature,-1); |
| 836 | messenger.SendMessage(&msg); |
| 837 | } |
| 838 | |
830 | 839 | |
831 | 840 | void |
832 | 841 | ScreenWindow::ScreenChanged(BRect frame, color_space mode) |
… |
… |
ScreenWindow::MessageReceived(BMessage* message)
|
878 | 887 | BPrivate::set_workspaces_layout(newColumns, newRows); |
879 | 888 | |
880 | 889 | _UpdateWorkspaceButtons(); |
| 890 | _UpdateWorkspaceWindow(); |
881 | 891 | _CheckApplyEnabled(); |
882 | 892 | break; |
883 | 893 | } |
diff --git a/src/preferences/screen/ScreenWindow.h b/src/preferences/screen/ScreenWindow.h
index b5bedd8..2638eb7 100644
a
|
b
|
private:
|
51 | 51 | |
52 | 52 | void _UpdateActiveMode(); |
53 | 53 | void _UpdateWorkspaceButtons(); |
| 54 | void _UpdateWorkspaceWindow(); |
54 | 55 | void _UpdateRefreshControl(); |
55 | 56 | void _UpdateMonitorView(); |
56 | 57 | void _UpdateControls(); |