diff options
author | Sam Spilsbury <smspillaz@gmail.com> | 2010-08-19 01:16:42 +0800 |
---|---|---|
committer | Sam Spilsbury <smspillaz@gmail.com> | 2010-08-19 01:16:42 +0800 |
commit | 0a0626ac6bdbfe1652c35586ac8b1758040dd668 (patch) | |
tree | 5d3656e2ebb5bc6f27f8fbe7373a151fdd2339b4 | |
parent | 6aaea013f0e3308a4fd846eb63bfe3f26394e591 (diff) | |
download | shift-0a0626ac6bdbfe1652c35586ac8b1758040dd668.tar.gz shift-0a0626ac6bdbfe1652c35586ac8b1758040dd668.tar.bz2 |
Make space between windows and maximum number of visible windows configurable
-rw-r--r-- | shift.xml.in | 15 | ||||
-rw-r--r-- | src/shift.cpp | 12 |
2 files changed, 21 insertions, 6 deletions
diff --git a/shift.xml.in b/shift.xml.in index 48e26b2..7b1bb22 100644 --- a/shift.xml.in +++ b/shift.xml.in @@ -270,6 +270,21 @@ <max>360</max> <precision>0.1</precision> </option> + <option name="cover_extra_space" type="float"> + <_short>Space Factor</_short> + <_long>How much windows should be spaced apart</_long> + <default>0</default> + <min>1</min> + <max>2</max> + <precision>0.1</precision> + </option> + <option name="cover_max_visible_windows" type="int"> + <_short>Maximum number of visible windows</_short> + <_long>How many windows should be visible at maximum in the cover mode</_long> + <default>10</default> + <min>1</min> + <max>100</max> + </option> </subgroup> <option name="overlay_icon" type="int"> <_short>Overlay Icon</_short> diff --git a/src/shift.cpp b/src/shift.cpp index 8a9876d..2b51fc0 100644 --- a/src/shift.cpp +++ b/src/shift.cpp @@ -585,10 +585,11 @@ ShiftScreen::layoutThumbsCover () yScale = 1.0f; - float val1 = floor((float) mNWindows / 2.0); + float val1 = floor((float) MIN (mNWindows, + optionGetCoverMaxVisibleWindows ()) / 2.0); float pos; - float space = maxThumbWidth / 2; + float space = (maxThumbWidth / 2); space *= cos (sin (PI / 4) * PI / 3); space *= 2; //space += (space / sin (PI / 4)) - space; @@ -611,8 +612,7 @@ ShiftScreen::layoutThumbsCover () pos = MIN (1.0, MAX (-1.0, distance)); - sw->mSlots[i].opacity = 1.0 - MIN (1.0, - MAX (0.0, fabs(distance) - val1)); + sw->mSlots[i].opacity = 1.0 - MIN (1.0, MAX (0.0, fabs(distance) - val1)); sw->mSlots[i].scale = MIN (xScale, yScale); sw->mSlots[i].y = centerY + (maxThumbHeight / 2.0) - @@ -621,7 +621,7 @@ ShiftScreen::layoutThumbsCover () if (fabs(distance) < 1.0) { - sw->mSlots[i].x = centerX + (sin(pos * PI * 0.5) * space); + sw->mSlots[i].x = centerX + (sin(pos * PI * 0.5) * space * optionGetCoverExtraSpace ()); sw->mSlots[i].z = fabs (distance); sw->mSlots[i].z *= -(maxThumbWidth / (2.0 * oe.width ())); @@ -635,7 +635,7 @@ ShiftScreen::layoutThumbsCover () (distance - pos) + (pos * (PI / 6.0)); sw->mSlots[i].x = centerX; - sw->mSlots[i].x += sin(ang) * rad * oe.width (); + sw->mSlots[i].x += sin(ang) * rad * oe.width () * optionGetCoverExtraSpace (); sw->mSlots[i].rotation = optionGetCoverAngle () + 30; sw->mSlots[i].rotation -= fabs(ang) * 180.0 / PI; |