mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Fixed scroll issues; text no longer overlaps on package lists (still truncated, but this at least is better)
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1287 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -145,7 +145,7 @@ void NativeLookEditor::onScroll(wxScrollWinEvent& ev) {
|
|||||||
y = y - page;
|
y = y - page;
|
||||||
} else if (ev.GetEventType() == wxEVT_SCROLLWIN_PAGEDOWN) {
|
} else if (ev.GetEventType() == wxEVT_SCROLLWIN_PAGEDOWN) {
|
||||||
y = y + page;
|
y = y + page;
|
||||||
} else if (ev.GetEventType() == wxEVT_SCROLLWIN_THUMBTRACK ||
|
} else if (ev.GetEventType() == wxEVT_SCROLLWIN_THUMBTRACK ||
|
||||||
ev.GetEventType() == wxEVT_SCROLLWIN_THUMBRELEASE) {
|
ev.GetEventType() == wxEVT_SCROLLWIN_THUMBRELEASE) {
|
||||||
y = ev.GetPosition();
|
y = ev.GetPosition();
|
||||||
}
|
}
|
||||||
@@ -177,14 +177,15 @@ void NativeLookEditor::scrollTo(int direction, int pos) {
|
|||||||
pos = max(0, min(bottom, pos));
|
pos = max(0, min(bottom, pos));
|
||||||
if (pos != y) {
|
if (pos != y) {
|
||||||
SetScrollPos(wxVERTICAL, pos);
|
SetScrollPos(wxVERTICAL, pos);
|
||||||
|
|
||||||
// move child controls
|
// move child controls
|
||||||
FOR_EACH(v, viewers) {
|
FOR_EACH(v, viewers) {
|
||||||
ValueEditor* e = v->getEditor();
|
ValueEditor* e = v->getEditor();
|
||||||
if (e) e->determineSize();
|
if (e) e->determineSize();
|
||||||
}
|
}
|
||||||
// redraw
|
|
||||||
onChange();
|
|
||||||
}
|
}
|
||||||
|
// redraw
|
||||||
|
onChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ DECLARE_TYPEOF_COLLECTION(PackagedP);
|
|||||||
PackageList::PackageList(Window* parent, int id, int direction, bool always_focused)
|
PackageList::PackageList(Window* parent, int id, int direction, bool always_focused)
|
||||||
: GalleryList(parent, id, direction, always_focused)
|
: GalleryList(parent, id, direction, always_focused)
|
||||||
{
|
{
|
||||||
item_size = subcolumns[0].size = wxSize(108, 150);
|
item_size = subcolumns[0].size = wxSize(125, 150);
|
||||||
SetThemeEnabled(true);
|
SetThemeEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27,6 +27,7 @@ size_t PackageList::itemCount() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PackageList::drawItem(DC& dc, int x, int y, size_t item) {
|
void PackageList::drawItem(DC& dc, int x, int y, size_t item) {
|
||||||
|
dc.SetClippingRegion(x, y, item_size.x, item_size.y);
|
||||||
PackageData& d = packages.at(item);
|
PackageData& d = packages.at(item);
|
||||||
RealRect rect(RealPoint(x,y),item_size);
|
RealRect rect(RealPoint(x,y),item_size);
|
||||||
RealPoint pos;
|
RealPoint pos;
|
||||||
@@ -45,6 +46,7 @@ void PackageList::drawItem(DC& dc, int x, int y, size_t item) {
|
|||||||
dc.GetTextExtent(d.package->full_name, &w, &h);
|
dc.GetTextExtent(d.package->full_name, &w, &h);
|
||||||
RealPoint text_pos = align_in_rect(ALIGN_CENTER, RealSize(w,h), rect);
|
RealPoint text_pos = align_in_rect(ALIGN_CENTER, RealSize(w,h), rect);
|
||||||
dc.DrawText(d.package->full_name, (int)text_pos.x, (int)text_pos.y + 130);
|
dc.DrawText(d.package->full_name, (int)text_pos.x, (int)text_pos.y + 130);
|
||||||
|
dc.DestroyClippingRegion();
|
||||||
}
|
}
|
||||||
|
|
||||||
struct PackageList::ComparePackagePosHint {
|
struct PackageList::ComparePackagePosHint {
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ case $UID in
|
|||||||
INSTALL_DIR='/usr/local/share/magicseteditor/';
|
INSTALL_DIR='/usr/local/share/magicseteditor/';
|
||||||
EXEC_SYMLINK='/usr/local/bin/magicseteditor';;
|
EXEC_SYMLINK='/usr/local/bin/magicseteditor';;
|
||||||
*)
|
*)
|
||||||
INSTALL_DIR=~'/.magicseteditor/';
|
INSTALL_DIR='$HOME/.magicseteditor/';
|
||||||
EXEC_SYMLINK=~'/bin/magicseteditor';
|
EXEC_SYMLINK='$HOME/bin/magicseteditor';
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ \"$MSE_INSTALL_DIR\" != "" ] then
|
if [ \"$MSE_INSTALL_DIR\" != "" ] then
|
||||||
|
|||||||
Reference in New Issue
Block a user