Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 194925 Details for
Bug 273309
app-portage/ufed-0.40-r10 doesn't work in an 80x24 terminal any more
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
ufed-0.40-termsize-2.patch
ufed-0.40-termsize-2.patch (text/plain), 5.79 KB, created by
Harald van Dijk (RETIRED)
on 2009-06-16 19:46:02 UTC
(
hide
)
Description:
ufed-0.40-termsize-2.patch
Filename:
MIME Type:
Creator:
Harald van Dijk (RETIRED)
Created:
2009-06-16 19:46:02 UTC
Size:
5.79 KB
patch
obsolete
> > Allow termsizes as small as allowing only one line in the list. > Bug #273309 by ulm > >--- ufed-0.40/ufed-curses.c >+++ ufed-0.40/ufed-curses.c >@@ -21,7 +21,7 @@ > static const struct key *keys; > > static struct item *items, *currentitem; >-int topy, minheight, minwidth; >+int topy, minwidth; > > static void checktermsize(void); > >@@ -53,7 +53,7 @@ > } > > static void checktermsize(void) { >- while(wHeight(List) < minheight >+ while(wHeight(List) < 1 > || wWidth(List) < minwidth) { > #ifdef KEY_RESIZE > clear(); >@@ -227,32 +227,13 @@ > } > > void scrollcurrent(void) { >- int oldtopy = topy; > if(currentitem->top < topy) >- topy = currentitem->top; >+ topy = max(currentitem->top, currentitem->top+currentitem->height-wHeight(List)); > else if(currentitem->top+currentitem->height > topy+wHeight(List)) >- topy = currentitem->top+currentitem->height-wHeight(List); >+ topy = min(currentitem->top+currentitem->height-wHeight(List), currentitem->top); > else > return; >- if(abs(topy-oldtopy)>wHeight(List)) { >- drawitems(); >+ drawitems(); >- } else { >- struct item *item = currentitem; >- scrollok(win(List), TRUE); >- wscrl(win(List), topy-oldtopy); >- scrollok(win(List), FALSE); >- if(topy<oldtopy) >- while((item=item->next)!=items >- && item->top < oldtopy >- && item->top < topy + wHeight(List)) >- (*drawitem)(item, FALSE); >- else >- while((item=item->prev)->next!=items >- && item->top > oldtopy >- && item->top + item->height-1 >= topy) >- (*drawitem)(item, FALSE); >- mvwhline(win(List), wHeight(List), 0, ' ', wWidth(List)); >- } > drawscrollbar(); > } > >@@ -282,8 +263,8 @@ > window[w].win = newwin(wHeight(w), wWidth(w), wTop(w), wLeft(w)); > } } > /* this won't work for the help viewer, but it doesn't use yesno() */ >- currentitem = items; > topy = 0; >+ scrollcurrent(); > draw(); > wattrset(win(Input), COLOR_PAIR(4) | A_BOLD | A_REVERSE); > mvwhline(win(Input), 0, 0, ' ', wWidth(Input)); >@@ -463,7 +444,11 @@ > > switch(c) { > case KEY_UP: >- if(currentitem!=items) { >+ if(currentitem->top<topy) { >+ (*drawitem)(currentitem, FALSE); >+ topy--; >+ (*drawitem)(currentitem, TRUE); >+ } else if(currentitem!=items || topy>currentitem->top) { > (*drawitem)(currentitem, FALSE); > currentitem = currentitem->prev; > scrollcurrent(); >@@ -472,7 +457,11 @@ > break; > > case KEY_DOWN: >- if(currentitem->next!=items) { >+ if(currentitem->top+currentitem->height>topy+wHeight(List)) { >+ (*drawitem)(currentitem, FALSE); >+ topy++; >+ (*drawitem)(currentitem, TRUE); >+ } else if(currentitem->next!=items) { > (*drawitem)(currentitem, FALSE); > currentitem = currentitem->next; > scrollcurrent(); >@@ -484,9 +473,9 @@ > if(currentitem!=items) { > struct item *olditem = currentitem; > (*drawitem)(currentitem, FALSE); >+ do currentitem = currentitem->prev; > while(currentitem!=items >- && olditem->top - currentitem->prev->top <= wHeight(List)) >+ && olditem->top - currentitem->prev->top <= wHeight(List)); >- currentitem = currentitem->prev; > scrollcurrent(); > (*drawitem)(currentitem, TRUE); > } >@@ -496,10 +485,10 @@ > if(currentitem->next!=items) { > struct item *olditem = currentitem; > (*drawitem)(currentitem, FALSE); >+ do currentitem = currentitem->next; > while(currentitem->next!=items > && (currentitem->next->top + currentitem->next->height) >- - (olditem->top + olditem->height) <= wHeight(List)) >+ - (olditem->top + olditem->height) <= wHeight(List)); >- currentitem = currentitem->next; > scrollcurrent(); > (*drawitem)(currentitem, TRUE); > } >@@ -531,11 +520,11 @@ > delwin(window[w].win); > window[w].win = newwin(wHeight(w), wWidth(w), wTop(w), wLeft(w)); > } } >- if(result==-1) >+ if(result==-1) { >- currentitem = items; >+ topy = 0; >+ scrollcurrent(); >- else >+ } else > items = currentitem; >- topy = 0; > draw(); > break; > #endif >--- ufed-0.40/ufed-curses-checklist.c >+++ ufed-0.40/ufed-curses-checklist.c >@@ -109,8 +109,6 @@ > flag->state = &line[state.start]; > > flag->item.height = ndescr; >- if(ndescr > minheight) >- minheight = ndescr; > { int i; for(i=0; i<ndescr; i++) { > flag->descr[i] = getline(input); > } } >@@ -174,11 +172,12 @@ > wattrset(win(List), COLOR_PAIR(3)); > else > wattrset(win(List), COLOR_PAIR(3) | A_BOLD | A_REVERSE); >- if(y < 0) { >+ if(y >= 0 || -y >= flag->item.height) { >+ d = &flag->descr[0]; >+ } else { > wmove(win(List), 0, 0); > d = &flag->descr[-y]; > y = 0; >- goto descriptiononly; > } > wmove(win(List), y, 0); > sprintf(buf, " %c%c%c %-*s %-5.5s ", >@@ -187,7 +186,6 @@ > flag->on == ' ' ? ')' : ']', > minwidth-12, flag->name, > flag->state); >- d = &flag->descr[0]; > if(d != &flag->descr[flag->item.height]) { > for(;;) { > sprintf(buf+minwidth, "%-*.*s", >@@ -198,7 +196,6 @@ > waddstr(win(List), buf); > d++; > y++; >- descriptiononly: > if(d!=&flag->descr[flag->item.height] && y<wHeight(List)) { > char *p; > for(p=buf; p!=buf+minwidth; p++) >@@ -214,7 +211,7 @@ > y++; > } > if(highlight) >- wmove(win(List), flag->item.top - topy, 2); >+ wmove(win(List), max(flag->item.top - topy, 0), 2); > wnoutrefresh(win(List)); > } > >--- ufed-0.40/ufed-curses.h >+++ ufed-0.40/ufed-curses.h >@@ -45,6 +45,8 @@ > static inline int wLeft (enum win w) { return (window[w].left >= 0 ? 0 : COLS ) + window[w].left ; } > static inline int wHeight(enum win w) { return (window[w].height > 0 ? 0 : LINES) + window[w].height; } > static inline int wWidth (enum win w) { return (window[w].width > 0 ? 0 : COLS ) + window[w].width ; } >+static inline int min(int a, int b) { return a < b ? a : b; } >+static inline int max(int a, int b) { return a > b ? a : b; } > >-extern int minheight, minwidth; >+extern int minwidth; > extern int topy;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 273309
:
194189
| 194925