summaryrefslogtreecommitdiff
path: root/src
diff options
authorNeil Jagdish Patel <neil.patel@canonical.com>2010-12-17 07:51:14 +0000
committerNeil Jagdish Patel <neil.patel@canonical.com>2010-12-17 07:51:14 +0000
commit4c8249aec8f7b3dcadc9245e219bd59bcf6e335e (patch)
treed48d3bc3d4bcd69e40c06ffb0696fec50cadd893 /src
parentae09d393f6c53cbb9732d738dd0f36dc5eec41ac (diff)
Add some comments and a few more renderering fixes
(bzr r669.3.25)
Diffstat (limited to 'src')
-rw-r--r--src/PanelMenuView.cpp4
-rw-r--r--src/PanelMenuView.h12
-rw-r--r--src/WindowButtons.cpp3
-rw-r--r--src/WindowButtons.h3
-rw-r--r--src/WindowManager.h10
5 files changed, 30 insertions, 2 deletions
diff --git a/src/PanelMenuView.cpp b/src/PanelMenuView.cpp
index 3dc3362a4..a32dac478 100644
--- a/src/PanelMenuView.cpp
+++ b/src/PanelMenuView.cpp
@@ -246,6 +246,8 @@ PanelMenuView::Draw (nux::GraphicsEngine& GfxContext, bool force_draw)
GfxContext.GetRenderStates ().SetBlend(false);
+ // The previous blend is too aggressive on the texture and therefore there
+ // is a slight loss of clarity. This fixes that
geo.width = button_width * (factor - 1);
gPainter.PushDrawLayer (GfxContext, geo, _title_layer);
geo = GetGeometry ();
@@ -403,7 +405,7 @@ PanelMenuView::Refresh ()
y = 0;
if (_is_maximized)
- x += _window_buttons->GetContentWidth () + PADDING;
+ x += _window_buttons->GetContentWidth () + PADDING + PADDING;
if (label)
{
diff --git a/src/PanelMenuView.h b/src/PanelMenuView.h
index ababc491d..66f2f0f04 100644
--- a/src/PanelMenuView.h
+++ b/src/PanelMenuView.h
@@ -33,6 +33,18 @@
class PanelMenuView : public PanelIndicatorObjectView
{
public:
+ // This contains all the menubar logic for the Panel. Mainly it contains
+ // the following states:
+ // 1. Unmaximized window + no mouse hover
+ // 2. Unmaximized window + mouse hover
+ // 3. Unmaximized window + active menu (Alt+F/arrow key nav)
+ // 4. Maximized window + no mouse hover
+ // 5. Maximized window + mouse hover
+ // 6. Maximized window + active menu
+ //
+ // It also deals with undecorating maximized windows (and redecorating them
+ // on unmaximize)
+
PanelMenuView ();
~PanelMenuView ();
diff --git a/src/WindowButtons.cpp b/src/WindowButtons.cpp
index cbb49af3b..53a984f29 100644
--- a/src/WindowButtons.cpp
+++ b/src/WindowButtons.cpp
@@ -42,6 +42,7 @@ enum
class WindowButton : public nux::Button
{
+ // A single window button
public:
WindowButton (int type)
: nux::Button ("X", NUX_TRACKER_LOCATION),
@@ -109,6 +110,8 @@ public:
void LoadImages (const char *name)
{
+ //FIXME: We need to somehow be theme aware. Or, at least support the themes
+ // we know and have a good default fallback
gchar *filename;
GError *error = NULL;
GdkPixbuf *_normal;
diff --git a/src/WindowButtons.h b/src/WindowButtons.h
index b4304de85..38e0415cc 100644
--- a/src/WindowButtons.h
+++ b/src/WindowButtons.h
@@ -25,6 +25,9 @@
class WindowButtons : public nux::HLayout, public Introspectable
{
+ // These are the [close][minimize][maximize] buttons on the panel when there
+ // is a maximized window
+
public:
WindowButtons ();
~WindowButtons ();
diff --git a/src/WindowManager.h b/src/WindowManager.h
index e8df76330..429aad2b4 100644
--- a/src/WindowManager.h
+++ b/src/WindowManager.h
@@ -24,8 +24,16 @@
class WindowManager
{
-public:
+ // This is a glue interface that breaks the dependancy of Unity with Compiz
+ // Basically it has a default implementation that does nothing useful, but
+ // the idea is that unity.cpp uses SetDefault() early enough in it's
+ // initialization so the things that require it get a usable implementation
+ //
+ // Currently only the Panel uses it but hopefully we'll get more of
+ // PluginAdaptor features moved into here and also get the Launcher to use
+ // it.
+public:
static WindowManager * Default ();
static void SetDefault (WindowManager *manager);