Commit 3b0ae6de authored by coppro's avatar coppro

Fixed scroll issues; text no longer overlaps on package lists (still...

Fixed scroll issues; text no longer overlaps on package lists (still truncated, but this at least is better)
parent 4db2960c
...@@ -145,7 +145,7 @@ void NativeLookEditor::onScroll(wxScrollWinEvent& ev) { ...@@ -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) { ...@@ -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); ...@@ -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 { ...@@ -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) { ...@@ -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 ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment