mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
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:
parent
e15456c5f6
commit
07fd025eef
3 changed files with 10 additions and 4 deletions
|
|
@ -1220,7 +1220,7 @@ public:
|
||||||
static Ctrl *GetDragAndDropTarget();
|
static Ctrl *GetDragAndDropTarget();
|
||||||
bool IsDragAndDropSource() { return this == GetDragAndDropSource(); }
|
bool IsDragAndDropSource() { return this == GetDragAndDropSource(); }
|
||||||
bool IsDragAndDropTarget() { return this == GetDragAndDropTarget(); }
|
bool IsDragAndDropTarget() { return this == GetDragAndDropTarget(); }
|
||||||
static Size StdSampleSize() { return Size(126, 106); }
|
static Size StdSampleSize() { return Size(DPI(126), DPI(106)); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static void SetSkin(void (*skin)());
|
static void SetSkin(void (*skin)());
|
||||||
|
|
|
||||||
|
|
@ -19,13 +19,19 @@ Ctrl *Ctrl::GetDragAndDropSource()
|
||||||
return dnd_source;
|
return dnd_source;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cairo_surface_t *CreateCairoSurface(const Image& img);
|
||||||
|
|
||||||
void Ctrl::GtkDragBegin(GtkWidget *widget, GdkDragContext *context, gpointer user_data)
|
void Ctrl::GtkDragBegin(GtkWidget *widget, GdkDragContext *context, gpointer user_data)
|
||||||
{
|
{
|
||||||
if(IsNull(dnd_icon))
|
if(IsNull(dnd_icon))
|
||||||
gtk_drag_set_icon_default(context);
|
gtk_drag_set_icon_default(context);
|
||||||
else {
|
else {
|
||||||
ImageGdk m(dnd_icon);
|
cairo_surface_t *surface = CreateCairoSurface(dnd_icon);
|
||||||
gtk_drag_set_icon_pixbuf(context, m, 0, 0);
|
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");
|
LLOG("GtkDragBegin");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
- Disabled empty combobox (FileSel::SelectDir) does not look nice
|
- Disabled empty combobox (FileSel::SelectDir) does not look nice
|
||||||
- ide menu in X11 ch
|
- ide menu in X11 ch
|
||||||
- TrayIconGtk warnings
|
- TrayIconGtk warnings
|
||||||
- DnD Sample size UHD
|
|
||||||
|
|
||||||
NTH:
|
NTH:
|
||||||
- spinbutton cosmetics
|
- spinbutton cosmetics
|
||||||
|
|
@ -70,3 +69,4 @@ DONE:
|
||||||
- OpenGL
|
- OpenGL
|
||||||
- GtkWnd warnings
|
- GtkWnd warnings
|
||||||
- GtkDnD warnings
|
- GtkDnD warnings
|
||||||
|
- DnD Sample size UHD
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue