windstille-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Windstille-devel] rev 351 - trunk/src


From: Ingo Ruhnke
Subject: [Windstille-devel] rev 351 - trunk/src
Date: Thu, 27 May 2004 00:53:36 +0200

Author: grumbel
Date: 2004-05-27 00:53:36 +0200 (Thu, 27 May 2004)
New Revision: 351

Modified:
   trunk/src/window.cxx
Log:
- added a primitive maximize functions

Modified: trunk/src/window.cxx
===================================================================
--- trunk/src/window.cxx        2004-05-26 22:42:08 UTC (rev 350)
+++ trunk/src/window.cxx        2004-05-26 22:53:36 UTC (rev 351)
@@ -44,14 +44,18 @@
   CL_Component* client_area;
   CL_Component* parent;
 
+  CL_Rect old_position;
+  bool is_maximized;
+
   Titlebar* titlebar;
-  CL_Component* close;
-  CL_Component* minimize;
-  CL_Component* maximize;
+  Icon* close;
+  Icon* minimize;
+  Icon* maximize;
 
   std::vector<CL_Slot> slots;
 
   void draw();
+  void do_maximize();
 };
 
 Window::Window(const CL_Rect& rect, const std::string& title, CL_Component* 
parent)
@@ -76,8 +80,11 @@
                                                CL_Size(rect.get_width()-10,
                                                        rect.get_height()-28)), 
this);
   impl->parent  = this;
- 
+  impl->is_maximized = false;
+
   impl->slots.push_back(sig_paint().connect(impl.get(),      
&WindowImpl::draw));
+  impl->slots.push_back(impl->maximize->sig_clicked().connect(impl.get(), 
&WindowImpl::do_maximize));
+
 }
 
 Window::~Window()
@@ -112,6 +119,23 @@
   */
 }
 
+void
+WindowImpl::do_maximize()
+{
+  // FIXME: Move this to scripting language
+  if (!is_maximized)
+    {
+      is_maximized = true;
+      old_position = parent->get_position();
+      parent->set_position(parent->get_parent()->get_position());
+    }
+  else
+    {
+      is_maximized = false;
+      parent->set_position(old_position);
+    }
+}
+
 CL_Component*
 Window::get_client_area()
 {





reply via email to

[Prev in Thread] Current Thread [Next in Thread]