ui_dpi: add SetUIDeviceDensity so Android DisplayMetrics can drive the UI scale instead of viewport-height fallback; fall back to GetWindowScaleDPI then viewport ratio when no device density is set. dropdown: use a subtle fixed panel radius (0.06) instead of the theme panel radius to avoid distortion during resize. theme_picker: widen the settings label gap (8->20) and grid label gap (6->12) for breathing room.
34 lines
900 B
C
34 lines
900 B
C
#ifndef UI_DPI_H
|
|
#define UI_DPI_H
|
|
|
|
#include "kryon.h"
|
|
|
|
#define UI_DPI_BASE_WIDTH 320
|
|
#define UI_DPI_BASE_HEIGHT 560
|
|
|
|
typedef struct UIDPIState {
|
|
int view_width;
|
|
int view_height;
|
|
float ui_scale;
|
|
float ui_scale_clamped;
|
|
float camera_zoom;
|
|
int base_width;
|
|
int base_height;
|
|
int needs_update;
|
|
} UIDPIState;
|
|
|
|
extern UIDPIState ui_dpi_state;
|
|
|
|
void InitUIDPI(void);
|
|
void FixUIDPIFramebufferColor(void);
|
|
void InvalidateUIDPI(void);
|
|
void SetUIDeviceDensity(float density);
|
|
void UpdateUIDPI(int view_width, int view_height);
|
|
int IsUIDPIDirty(void);
|
|
static inline float GetUIDPIScale(void) { return ui_dpi_state.ui_scale_clamped; }
|
|
static inline int GetUIDPIViewWidth(void) { return ui_dpi_state.view_width; }
|
|
static inline int GetUIDPIViewHeight(void) { return ui_dpi_state.view_height; }
|
|
static inline float GetUIDPICameraZoom(void) { return ui_dpi_state.camera_zoom; }
|
|
|
|
#endif
|