CtrlCore: Fixed scaling of DnD drag icon

git-svn-id: svn://ultimatepp.org/upp/trunk@13894 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2020-01-15 20:07:33 +00:00
parent e15456c5f6
commit 07fd025eef
3 changed files with 10 additions and 4 deletions

View file

@ -1220,7 +1220,7 @@ public:
static Ctrl *GetDragAndDropTarget();
bool IsDragAndDropSource() { return this == GetDragAndDropSource(); }
bool IsDragAndDropTarget() { return this == GetDragAndDropTarget(); }
static Size StdSampleSize() { return Size(126, 106); }
static Size StdSampleSize() { return Size(DPI(126), DPI(106)); }
public:
static void SetSkin(void (*skin)());

View file

@ -19,13 +19,19 @@ Ctrl *Ctrl::GetDragAndDropSource()
return dnd_source;
}
cairo_surface_t *CreateCairoSurface(const Image& img);
void Ctrl::GtkDragBegin(GtkWidget *widget, GdkDragContext *context, gpointer user_data)
{
if(IsNull(dnd_icon))
gtk_drag_set_icon_default(context);
else {
ImageGdk m(dnd_icon);
gtk_drag_set_icon_pixbuf(context, m, 0, 0);
cairo_surface_t *surface = CreateCairoSurface(dnd_icon);
double scale = SCL(1);
cairo_surface_set_device_scale(surface, scale, scale);
cairo_surface_set_device_offset(surface, DPI(8), DPI(8));
gtk_drag_set_icon_surface(context, surface);
cairo_surface_destroy(surface);
}
LLOG("GtkDragBegin");
}

View file

@ -6,7 +6,6 @@
- Disabled empty combobox (FileSel::SelectDir) does not look nice
- ide menu in X11 ch
- TrayIconGtk warnings
- DnD Sample size UHD
NTH:
- spinbutton cosmetics
@ -70,3 +69,4 @@ DONE:
- OpenGL
- GtkWnd warnings
- GtkDnD warnings
- DnD Sample size UHD