aboutsummaryrefslogtreecommitdiff
path: root/src/Slit.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-06-18 13:55:17 (GMT)
committerfluxgen <fluxgen>2003-06-18 13:55:17 (GMT)
commite3ab62fed1e63be3e7f6b81c316b15097638faf6 (patch)
tree563a2d45e6e33de08f2b899bbe775f9b2a5a755b /src/Slit.cc
parent501168b557f4c21ca10dfdaad7776c125968363a (diff)
downloadfluxbox_pavel-e3ab62fed1e63be3e7f6b81c316b15097638faf6.zip
fluxbox_pavel-e3ab62fed1e63be3e7f6b81c316b15097638faf6.tar.bz2
added strut support
Diffstat (limited to 'src/Slit.cc')
-rw-r--r--src/Slit.cc61
1 files changed, 59 insertions, 2 deletions
diff --git a/src/Slit.cc b/src/Slit.cc
index 83d2928..d6629b5 100644
--- a/src/Slit.cc
+++ b/src/Slit.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Slit.cc,v 1.60 2003/06/13 05:03:43 fluxgen Exp $ 25// $Id: Slit.cc,v 1.61 2003/06/18 13:49:43 fluxgen Exp $
26 26
27#include "Slit.hh" 27#include "Slit.hh"
28 28
@@ -291,7 +291,8 @@ Slit::Slit(BScreen &scr, FbTk::XLayer &layer, const char *filename)
291 "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR", False)), //KDE v2.x 291 "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR", False)), //KDE v2.x
292 292
293 m_layeritem(0), 293 m_layeritem(0),
294 m_slit_theme(new SlitTheme(*this)) { 294 m_slit_theme(new SlitTheme(*this)),
295 m_strut(0) {
295 296
296 // default placement and direction 297 // default placement and direction
297 m_direction = screen().getSlitDirection(); 298 m_direction = screen().getSlitDirection();
@@ -339,10 +340,65 @@ Slit::Slit(BScreen &scr, FbTk::XLayer &layer, const char *filename)
339 340
340 341
341Slit::~Slit() { 342Slit::~Slit() {
343 clearStrut();
342 if (frame.pixmap != 0) 344 if (frame.pixmap != 0)
343 screen().imageControl().removeImage(frame.pixmap); 345 screen().imageControl().removeImage(frame.pixmap);
344} 346}
345 347
348void Slit::clearStrut() {
349 if (m_strut != 0) {
350 screen().clearStrut(m_strut);
351 m_strut = 0;
352 }
353}
354
355void Slit::updateStrut() {
356 clearStrut();
357 // no need for area if we're autohiding
358 if (doAutoHide())
359 return;
360
361 int left = 0, right = 0, top = 0, bottom = 0;
362 switch (placement()) {
363 case TOPLEFT:
364 top = height();
365 left = width();
366 break;
367 case TOPCENTER:
368 top = height();
369 break;
370 case TOPRIGHT:
371 right = width();
372 top = height();
373 break;
374 case BOTTOMLEFT:
375 bottom = height();
376 left = width();
377 break;
378 case BOTTOMCENTER:
379 // would be strange to have it request size on vertical direction
380 // each time we add a client
381 if (direction() == HORIZONTAL)
382 bottom = height();
383 break;
384 case BOTTOMRIGHT:
385 if (direction() == HORIZONTAL)
386 bottom = height();
387 else
388 right = width();
389 break;
390 case CENTERLEFT:
391 if (direction() == VERTICAL)
392 left = width();
393 break;
394 case CENTERRIGHT:
395 if (direction() == VERTICAL)
396 right = width();
397 break;
398 }
399 m_strut = screen().requestStrut(left, right, top, bottom);
400 screen().updateAvailableWorkspaceArea();
401}
346 402
347void Slit::addClient(Window w) { 403void Slit::addClient(Window w) {
348#ifdef DEBUG 404#ifdef DEBUG
@@ -777,6 +833,7 @@ void Slit::reconfigure() {
777 833
778 m_slitmenu.reconfigure(); 834 m_slitmenu.reconfigure();
779 updateClientmenu(); 835 updateClientmenu();
836 updateStrut();
780} 837}
781 838
782 839