aboutsummaryrefslogtreecommitdiff
path: root/src/IconBar.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-01-04 21:21:43 (GMT)
committerfluxgen <fluxgen>2002-01-04 21:21:43 (GMT)
commitbec0065e4a5a4d0c487bd47ec208b9d30a7b9399 (patch)
tree916d78b2c52f6f4241d7a50ece648e96d16e0ea9 /src/IconBar.cc
parent502f1a959cf14691097d2fcdefc5afdcf8e706d5 (diff)
downloadfluxbox-bec0065e4a5a4d0c487bd47ec208b9d30a7b9399.zip
fluxbox-bec0065e4a5a4d0c487bd47ec208b9d30a7b9399.tar.bz2
pekdon patch
Diffstat (limited to 'src/IconBar.cc')
-rw-r--r--src/IconBar.cc31
1 files changed, 25 insertions, 6 deletions
diff --git a/src/IconBar.cc b/src/IconBar.cc
index f5ec382..49050e0 100644
--- a/src/IconBar.cc
+++ b/src/IconBar.cc
@@ -152,14 +152,14 @@ void IconBar::exposeEvent(XExposeEvent *ee) {
152 } 152 }
153 153
154 if (obj) { 154 if (obj) {
155 155
156 Window root; 156 Window root;
157 unsigned int width, height; 157 unsigned int width, height;
158 unsigned int border_width, depth; //not used 158 unsigned int border_width, depth; //not used
159 int x, y; 159 int x, y;
160 XGetGeometry(m_display, m_parent, &root, &x, &y, &width, &height, 160 XGetGeometry(m_display, m_parent, &root, &x, &y, &width, &height,
161 &border_width, &depth); 161 &border_width, &depth);
162 162
163 //max width on every icon 163 //max width on every icon
164 unsigned int icon_width = width / m_iconlist->count(); 164 unsigned int icon_width = width / m_iconlist->count();
165 165
@@ -190,7 +190,7 @@ void IconBar::repositionIcons(void) {
190 190
191 //load right size of theme 191 //load right size of theme
192 loadTheme(icon_width, height); 192 loadTheme(icon_width, height);
193 193
194 IconListIterator it(m_iconlist); 194 IconListIterator it(m_iconlist);
195 195
196 for (x = 0; it.current(); it++, x+=icon_width) { 196 for (x = 0; it.current(); it++, x+=icon_width) {
@@ -271,8 +271,7 @@ void IconBar::draw(IconBarObj *obj, int width) {
271 if (l < width) 271 if (l < width)
272 break; 272 break;
273 } 273 }
274 274
275
276 switch (m_screen->getWindowStyle()->tab.font.justify) { 275 switch (m_screen->getWindowStyle()->tab.font.justify) {
277 case Misc::Font::RIGHT: 276 case Misc::Font::RIGHT:
278 dx += width - l; 277 dx += width - l;
@@ -284,7 +283,7 @@ void IconBar::draw(IconBarObj *obj, int width) {
284 break; 283 break;
285 } 284 }
286 285
287 //Draw title to m_tabwin 286 //Draw title to m_iconwin
288 287
289 XClearWindow(m_display, iconwin); 288 XClearWindow(m_display, iconwin);
290 289
@@ -328,6 +327,7 @@ FluxboxWindow *IconBar::findWindow(Window w) {
328// returns pointer to IconBarObj on success else 327// returns pointer to IconBarObj on success else
329// 0 on failure 328// 0 on failure
330//------------------------------------ 329//------------------------------------
330
331IconBarObj *IconBar::findIcon(FluxboxWindow *fluxboxwin) { 331IconBarObj *IconBar::findIcon(FluxboxWindow *fluxboxwin) {
332 332
333 IconListIterator it(m_iconlist); 333 IconListIterator it(m_iconlist);
@@ -341,3 +341,22 @@ IconBarObj *IconBar::findIcon(FluxboxWindow *fluxboxwin) {
341 341
342 return 0; 342 return 0;
343} 343}
344
345//---------- getIconWidth ------------
346// will return the width of an icon
347// window
348//------------------------------------
349unsigned int IconBarObj::getWidth() {
350 Window root;
351
352 unsigned int width, height;
353 unsigned int border_width, depth; //not used
354 int x, y; //not used
355
356 Display *m_display = Fluxbox::instance()->getXDisplay();
357
358 XGetGeometry(m_display, m_iconwin, &root, &x, &y,
359 &width, &height, &border_width, &depth);
360
361 return width;
362}