Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37728720
en ru br
Репозитории ALT
S:0.96.0-alt1
5.1: 0.92.0-alt6
4.1: 0.92.0-alt2
4.0: 0.92.0-alt2
3.0: 0.91.0-alt1
+backports:0.92.0-alt0.M30.1
www.altlinux.org/Changes

Группа :: Графические оболочки/Window Maker
Пакет: WindowMaker

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: WindowMaker-0.91.0-alt-titlebar.patch
Скачать


--- WindowMaker-0.91.0/src/window.c.vns	2005-05-18 15:51:45 +0400
+++ WindowMaker-0.91.0/src/window.c	2005-05-18 15:55:55 +0400
@@ -1293,7 +1293,10 @@
 
     wwin->frame = wFrameWindowCreate(scr, window_level,
                                      x, y, width, height,
-                                     &wPreferences.window_title_clearance, foo,
+				     &wPreferences.window_title_clearance,
+				     &wPreferences.window_title_min_height,
+				     &wPreferences.window_title_max_height,
+				     foo,
                                      scr->window_title_texture,
                                      scr->resizebar_texture,
                                      scr->window_title_color,
@@ -1630,7 +1633,10 @@
     wwin->frame = wFrameWindowCreate(scr, WMFloatingLevel,
                                      wwin->frame_x, wwin->frame_y,
                                      width, height,
-                                     &wPreferences.window_title_clearance, foo,
+                                     &wPreferences.window_title_clearance,
+                                     &wPreferences.window_title_min_height,
+                                     &wPreferences.window_title_max_height,
+		                     foo,
                                      scr->window_title_texture,
                                      scr->resizebar_texture,
                                      scr->window_title_color,
--- WindowMaker-0.91.0/src/defaults.c.vns	2005-05-18 15:51:45 +0400
+++ WindowMaker-0.91.0/src/defaults.c	2005-05-18 15:51:45 +0400
@@ -376,6 +376,8 @@
 };
 
 
+#define NUM2STRING_(x) #x
+#define NUM2STRING(x) NUM2STRING_(x)
 
 WDefaultEntry optionList[] = {
     /* dynamic options */
@@ -601,9 +603,21 @@
     {"WindowTitleExtendSpace",	DEF_WINDOW_TITLE_EXTEND_SPACE,	       	NULL,
     &wPreferences.window_title_clearance,	getInt,		setClearance
     },
+    {"WindowTitleMinHeight",	"0",	       	NULL,
+    &wPreferences.window_title_min_height,	getInt,		setClearance
+    },
+    {"WindowTitleMaxHeight",	NUM2STRING(INT_MAX),	NULL,
+    &wPreferences.window_title_max_height,	getInt,		setClearance
+    },
     {"MenuTitleExtendSpace",	DEF_MENU_TITLE_EXTEND_SPACE,	       	NULL,
     &wPreferences.menu_title_clearance,	getInt,		setClearance
     },
+    {"MenuTitleMinHeight",	"0",	       	NULL,
+    &wPreferences.menu_title_min_height,	getInt,		setClearance
+    },
+    {"MenuTitleMaxHeight",	NUM2STRING(INT_MAX),	NULL,
+    &wPreferences.menu_title_max_height,	getInt,		setClearance
+    },
     {"MenuTextExtendSpace",	DEF_MENU_TEXT_EXTEND_SPACE,	       	NULL,
     &wPreferences.menu_text_clearance,	getInt,		setClearance
     },
--- WindowMaker-0.91.0/src/WindowMaker.h.vns	2005-05-18 15:51:45 +0400
+++ WindowMaker-0.91.0/src/WindowMaker.h	2005-05-18 15:51:45 +0400
@@ -371,7 +371,11 @@
     signed char title_justification;	       /* titlebar text alignment */
 
     int window_title_clearance;
+    int window_title_min_height;
+    int window_title_max_height;
     int menu_title_clearance;
+    int menu_title_min_height;
+    int menu_title_max_height;
     int menu_text_clearance;
 
     char multi_byte_text;
--- WindowMaker-0.91.0/src/framewin.c.vns	2005-05-18 15:51:45 +0400
+++ WindowMaker-0.91.0/src/framewin.c	2005-05-18 15:54:16 +0400
@@ -63,7 +63,8 @@
 
 WFrameWindow*
 wFrameWindowCreate(WScreen *scr, int wlevel, int x, int y,
-                   int width, int height, int *clearance, int flags,
+		   int width, int height, int *clearance,
+		   int *title_min, int *title_max, int flags,
                    WTexture **title_texture, WTexture **resize_texture,
                    WMColor **color, WMFont **font)
 {
@@ -80,6 +81,8 @@
     fwin->resizebar_texture = resize_texture;
     fwin->title_color = color;
     fwin->title_clearance = clearance;
+    fwin->title_min_height = title_min;
+    fwin->title_max_height = title_max;
     fwin->font = font;
 #ifdef KEEP_XKB_LOCK_STATUS
     fwin->languagemode = XkbGroup1Index;
@@ -130,7 +133,11 @@
         height = fwin->core->height - fwin->top_width - fwin->bottom_width;
 
     if (flags & WFF_TITLEBAR)
-        theight = WMFontHeight(*fwin->font) + (*fwin->title_clearance + TITLEBAR_EXTEND_SPACE) * 2;
+    {
+	theight = WMFontHeight(*fwin->font) + (*fwin->title_clearance + TITLEBAR_EXTEND_SPACE) * 2;
+	if(theight > *fwin->title_max_height) theight = *fwin->title_max_height;
+	if(theight < *fwin->title_min_height) theight = *fwin->title_min_height;
+    }
     else
         theight = 0;
 
@@ -490,6 +497,8 @@
     int theight;
 
     theight = WMFontHeight(*fwin->font) + (*fwin->title_clearance + TITLEBAR_EXTEND_SPACE) * 2;
+    if(theight > *fwin->title_max_height) theight = *fwin->title_max_height;
+    if(theight < *fwin->title_min_height) theight = *fwin->title_min_height;
 
     x = 0;
     w = fwin->core->width + 1;
@@ -1097,8 +1106,11 @@
                 break;
             }
 
+
             y = *fwin->title_clearance + TITLEBAR_EXTEND_SPACE;
             h = WMFontHeight(*fwin->font);
+            if(y*2 + h > *fwin->title_max_height) y = (*fwin->title_max_height - h)/2;
+            if(y*2 + h < *fwin->title_min_height) y = (*fwin->title_min_height - h)/2;
 
             /* We use a w+2 buffer to have an extra pixel on the left and
              * another one on the right. This is because for some odd reason,
--- WindowMaker-0.91.0/src/menu.c.vns	2005-05-18 15:51:45 +0400
+++ WindowMaker-0.91.0/src/menu.c	2005-05-18 15:51:45 +0400
@@ -180,7 +180,10 @@
         menu->flags.titled = 1;
     }
     menu->frame =
-        wFrameWindowCreate(screen, tmp, 8, 2, 1, 1, &wPreferences.menu_title_clearance, flags,
+        wFrameWindowCreate(screen, tmp, 8, 2, 1, 1, &wPreferences.menu_title_clearance,
+		           &wPreferences.menu_title_min_height,
+			   &wPreferences.menu_title_max_height,
+			   flags,
                            screen->menu_title_texture, NULL,
                            screen->menu_title_color,
                            &screen->menu_title_font);
--- WindowMaker-0.91.0/src/framewin.h.vns	2004-10-15 01:24:06 +0400
+++ WindowMaker-0.91.0/src/framewin.h	2005-05-18 15:56:27 +0400
@@ -59,6 +59,8 @@
 
     short top_width;
     int *title_clearance;
+    int *title_min_height;
+    int *title_max_height;
     short bottom_width;
 
     short resizebar_corner_width;
@@ -149,7 +151,8 @@
 
 WFrameWindow*
 wFrameWindowCreate(WScreen *scr, int wlevel, int x, int y,
-                   int width, int height, int *clearance, int flags,
+		   int width, int height, int *clearance,
+		   int *title_min, int *title_max, int flags,
                    union WTexture **title_texture,
                    union WTexture **resize_texture,
                    WMColor **color, WMFont **font);
--- WindowMaker-0.91.0/src/moveres.c.vns	2004-10-24 23:36:09 +0400
+++ WindowMaker-0.91.0/src/moveres.c	2005-05-18 15:51:45 +0400
@@ -497,6 +497,8 @@
 
     if (HAS_TITLEBAR(wwin) && !wwin->flags.shaded) {
         h = WMFontHeight(wwin->screen_ptr->title_font) + (wPreferences.window_title_clearance + TITLEBAR_EXTEND_SPACE) * 2;
+	if(h > wPreferences.window_title_max_height) h = wPreferences.window_title_max_height;
+	if(h < wPreferences.window_title_min_height) h = wPreferences.window_title_min_height;
     }
     if (HAS_RESIZEBAR(wwin) && !wwin->flags.shaded) {
         /* Can't use wwin-frame->bottom_width because, in some cases
--- WindowMaker-0.91.0/src/placement.c.vns	2004-10-23 03:58:59 +0400
+++ WindowMaker-0.91.0/src/placement.c	2005-05-18 15:57:35 +0400
@@ -594,6 +594,9 @@
 {
     WScreen *scr = wwin->screen_ptr;
     int h = WMFontHeight(scr->title_font) + (wPreferences.window_title_clearance + TITLEBAR_EXTEND_SPACE) * 2;
+    if(h > wPreferences.window_title_max_height) h = wPreferences.window_title_max_height;
+    if(h < wPreferences.window_title_min_height) h = wPreferences.window_title_min_height;
+
     WArea usableArea = wGetUsableAreaForHead(scr,
                                              wGetHeadForPointerLocation(scr),
                                              NULL, True);
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin