Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Huevos committed Oct 11, 2023
1 parent 546119c commit ac84823
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 18 deletions.
2 changes: 0 additions & 2 deletions lib/gui/elistbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ class iListboxContent: public iObject
virtual int getItemHeight()=0;
virtual int getItemWidth() { return -1; }
virtual int getOrientation() { return 1; }
virtual int getMaxItemTextWidth() { return 1; }

eListbox *m_listbox;
#endif
Expand Down Expand Up @@ -185,7 +184,6 @@ class eListbox: public eWidget

int getScrollbarWidth() { return m_scrollbar_width; }
int getScrollbarHeight() { return m_scrollbar_height; }
int getMaxItemTextWidth() { return m_content->getMaxItemTextWidth(); }

#ifndef SWIG
struct eListboxStyle *getLocalStyle(void);
Expand Down
12 changes: 1 addition & 11 deletions lib/gui/elistboxcontent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ int iListboxContent::currentCursorSelectable()
DEFINE_REF(eListboxPythonStringContent);

eListboxPythonStringContent::eListboxPythonStringContent()
:m_cursor(0), m_saved_cursor(0), m_itemheight(25), m_itemwidth(25), m_max_text_width(0), m_orientation(1)
:m_cursor(0), m_saved_cursor(0), m_itemheight(25), m_itemwidth(25), m_orientation(1)
{
}

Expand Down Expand Up @@ -275,16 +275,6 @@ void eListboxPythonStringContent::paint(gPainter &painter, eWindowStyle &style,
flags |= gPainter::RT_HALIGN_BLOCK;
}

eRect textRect = eRect(text_offset, m_itemsize);

ePtr<eTextPara> para = new eTextPara(textRect);
para->setFont(fnt);
para->renderString(string);
int textWidth = para->getBoundBox().width();
if (textWidth > m_max_text_width) {
m_max_text_width = textWidth;
}

painter.renderText(eRect(text_offset, m_itemsize),
string, flags, border_color, border_size);
}
Expand Down
2 changes: 0 additions & 2 deletions lib/gui/elistboxcontent.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class eListboxPythonStringContent: public virtual iListboxContent
void invalidateEntry(int index);
void invalidate();
eSize getItemSize() { return m_itemsize; }
int getMaxItemTextWidth() { return m_max_text_width; }
#ifndef SWIG
protected:
void cursorHome();
Expand Down Expand Up @@ -54,7 +53,6 @@ class eListboxPythonStringContent: public virtual iListboxContent
ePtr<gFont> m_font;
int m_itemheight;
int m_itemwidth;
int m_max_text_width;
int m_orientation;
#endif
};
Expand Down
3 changes: 0 additions & 3 deletions lib/python/Screens/MessageBox.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,3 @@ def move(self, direction):

def __repr__(self):
return "%s(%s)" % (str(type(self)), self.text)

def getListWidth(self):
return self["list"].instance.getMaxItemTextWidth()

0 comments on commit ac84823

Please sign in to comment.