diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-02-28 20:37:19 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-02-28 20:37:19 +0400 |
commit | 28444a4831ae17f2cbe540a9bb721eb12161a289 (patch) | |
tree | 191141ebbce9993cefa2ff56f8dc72e1e77b4817 /source/blender | |
parent | 5f1978dbd25b0705a10f9ad5085e9032d99bf78a (diff) |
UI/DPI: user preferences window size now takes into account DPI, otherwise the
buttons don't fit properly.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 1 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 8 |
2 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 78689c078c6..3c8a9a87fbe 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -183,6 +183,7 @@ typedef struct uiLayout uiLayout; /* scale fixed button widths by this to account for DPI */ #define UI_DPI_FAC ((U.pixelsize * (float)U.dpi) / 72.0f) +#define UI_DPI_WINDOW_FAC (((float)U.dpi) / 72.0f) /* 16 to copy ICON_DEFAULT_HEIGHT */ #define UI_DPI_ICON_SIZE ((float)16 * UI_DPI_FAC) diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 49ce5584421..fcd0968d52f 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -3427,8 +3427,8 @@ static int userpref_show_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *ev rcti rect; int sizex, sizey; - sizex = 800; - sizey = 480; + sizex = 800 * UI_DPI_WINDOW_FAC; + sizey = 480 * UI_DPI_WINDOW_FAC; /* some magic to calculate postition */ /* pixelsize: mouse coords are in U.pixelsize units :/ */ @@ -3447,8 +3447,8 @@ static int userpref_show_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *ev static void SCREEN_OT_userpref_show(struct wmOperatorType *ot) { /* identifiers */ - ot->name = "Show/Hide User Preferences"; - ot->description = "Show/hide user preferences"; + ot->name = "Show User Preferences"; + ot->description = "Show user preferences"; ot->idname = "SCREEN_OT_userpref_show"; /* api callbacks */ |