summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/compiztoolbox/include/compiztoolbox/compiztoolbox.h2
-rw-r--r--plugins/switcher/src/switcher.cpp24
2 files changed, 12 insertions, 14 deletions
diff --git a/plugins/compiztoolbox/include/compiztoolbox/compiztoolbox.h b/plugins/compiztoolbox/include/compiztoolbox/compiztoolbox.h
index 8bd9d66..3223348 100644
--- a/plugins/compiztoolbox/include/compiztoolbox/compiztoolbox.h
+++ b/plugins/compiztoolbox/include/compiztoolbox/compiztoolbox.h
@@ -159,7 +159,7 @@ class BaseSwitchWindow
CompWindow *window;
};
-#define ICON_SIZE 64
+#define ICON_SIZE 48
#define MAX_ICON_SIZE 256
#endif
diff --git a/plugins/switcher/src/switcher.cpp b/plugins/switcher/src/switcher.cpp
index 83e32d7..90c5ce4 100644
--- a/plugins/switcher/src/switcher.cpp
+++ b/plugins/switcher/src/switcher.cpp
@@ -894,10 +894,15 @@ SwitchWindow::updateIconTexturedWindow (GLWindowPaintAttrib &sAttrib,
int y,
GLTexture *icon)
{
- sAttrib.xScale = sAttrib.yScale = 1.0f;
+ sAttrib.xScale = (float) ICON_SIZE / icon->width ();
+ sAttrib.yScale = (float) ICON_SIZE / icon->height ();
+ if (sAttrib.xScale < sAttrib.yScale)
+ sAttrib.yScale = sAttrib.xScale;
+ else
+ sAttrib.xScale = sAttrib.yScale;
- wx = x + WIDTH - icon->width () - SPACE;
- wy = y + HEIGHT - icon->height () - SPACE;
+ wx = x + WIDTH - icon->width () * sAttrib.xScale - SPACE;
+ wy = y + HEIGHT - icon->height () * sAttrib.yScale - SPACE;
}
void
@@ -910,20 +915,13 @@ SwitchWindow::updateIconNontexturedWindow (GLWindowPaintAttrib &sAttrib,
int y,
GLTexture *icon)
{
- int iw, ih;
+ float iw, ih;
iw = width - SPACE;
ih = height - SPACE;
- if ((int)icon->width () < (iw >> 1))
- sAttrib.xScale = (iw / icon->width ());
- else
- sAttrib.xScale = 1.0f;
-
- if ((int)icon->height () < (ih >> 1))
- sAttrib.yScale = (ih / icon->height ());
- else
- sAttrib.yScale = 1.0f;
+ sAttrib.xScale = iw / icon->width ();
+ sAttrib.yScale = ih / icon->height ();
if (sAttrib.xScale < sAttrib.yScale)
sAttrib.yScale = sAttrib.xScale;