From: Holger Schemel Date: Fri, 3 Nov 2017 18:30:55 +0000 (+0100) Subject: added options for custom position of editor tooltip (mouse-over info text) X-Git-Tag: 4.1.0.0~71 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=d298323ec00b208324df23aecff55a808efce26a;p=rocksndiamonds.git added options for custom position of editor tooltip (mouse-over info text) --- diff --git a/src/conf_gfx.c b/src/conf_gfx.c index 07525b6f..4be0ac31 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -9272,6 +9272,8 @@ struct ConfigInfo image_config[] = { "editor.settings.tabs.2nd_yoffset", "64" }, { "editor.settings.tabs.draw_xoffset", "0" }, { "editor.settings.tabs.draw_yoffset", "8" }, + { "editor.settings.tooltip.x", "-1" }, + { "editor.settings.tooltip.y", "-1" }, { "editor.gadget.normal_spacing", "4" }, { "editor.gadget.small_spacing", "2" }, diff --git a/src/editor.c b/src/editor.c index 5f9b2b9d..5c8b67bf 100644 --- a/src/editor.c +++ b/src/editor.c @@ -346,8 +346,12 @@ #define INFOTEXT_XSIZE SXSIZE #define INFOTEXT_YSIZE getFontHeight(INFOTEXT_FONT) #define INFOTEXT_YSIZE_FULL (INFOTEXT_YSIZE + ED_GADGET_SMALL_DISTANCE) -#define INFOTEXT_XPOS SX -#define INFOTEXT_YPOS (SY + SYSIZE - INFOTEXT_YSIZE) +#define INFOTEXT_X (editor.settings.tooltip.x) +#define INFOTEXT_Y (editor.settings.tooltip.y) +#define INFOTEXT_XY_REDEFINED (INFOTEXT_X != -1 || INFOTEXT_Y != -1) +#define INFOTEXT_XPOS SX + (INFOTEXT_XY_REDEFINED ? INFOTEXT_X : 0) +#define INFOTEXT_YPOS SY + (INFOTEXT_XY_REDEFINED ? INFOTEXT_Y : \ + SYSIZE - INFOTEXT_YSIZE) /* @@ -8204,7 +8208,8 @@ static int getMaxEdFieldX(boolean has_scrollbar) static int getMaxEdFieldY(boolean has_scrollbar) { - int infotext_height = INFOTEXT_YSIZE_FULL; + int infotext_height = (IN_PIX_FIELD(INFOTEXT_XPOS - SX, INFOTEXT_YPOS - SY) ? + INFOTEXT_YSIZE_FULL : 0); int scrollbar_height = (has_scrollbar ? ED_SCROLLBUTTON_YSIZE : 0); int sysize = SYSIZE - scrollbar_height - infotext_height; int max_ed_fieldy = sysize / ed_tilesize; diff --git a/src/main.h b/src/main.h index 1c23407d..33725179 100644 --- a/src/main.h +++ b/src/main.h @@ -75,6 +75,7 @@ ((x) >= (xmin) && (x) <= (xmax) && \ (y) >= (ymin) && (y) <= (ymax)) +#define IN_PIX_FIELD(x, y) IN_FIELD(x, y, SXSIZE, SYSIZE) #define IN_VIS_FIELD(x, y) IN_FIELD(x, y, SCR_FIELDX, SCR_FIELDY) #define IN_LEV_FIELD(x, y) IN_FIELD(x, y, lev_fieldx, lev_fieldy) #define IN_SCR_FIELD(x, y) IN_FIELD_MINMAX(x,y, BX1,BY1, BX2,BY2) @@ -2817,6 +2818,8 @@ struct EditorSettingsInfo struct XY element_name; struct EditorTabsInfo tabs; + + struct XY tooltip; }; struct EditorGadgetInfo