Ticket #4192: 4192-v1.patch
File 4192-v1.patch, 5.6 KB (added by , 16 years ago) |
---|
-
libs/libmyth/uilistbtntype.h
176 176 void SetMargin(int margin); 177 177 void SetItemRegColor(const QColor& beg, const QColor& end, uint alpha); 178 178 void SetItemSelColor(const QColor& beg, const QColor& end, uint alpha); 179 void SetJustification(int justification) { m_justify = justification; } 179 180 180 181 void Draw(QPainter *p, int order, int context); 181 182 void Draw(QPainter *p, int order, int context, bool active_on); … … 238 239 int m_itemMargin; 239 240 uint m_itemsVisible; 240 241 242 int m_justify; 243 241 244 bool m_active; 242 245 bool m_visible; 243 246 bool m_showScrollArrows; … … 334 337 void setOverrideInactive(bool flag); 335 338 bool getOverrideInactive(void); 336 339 340 void setJustification(int justification) { m_justify = justification; } 341 int getJustification(void) const { return m_justify; } 342 337 343 bool moveUpDown(bool flag); 338 344 339 345 void paint(QPainter *p, fontProp *font, int x, int y, bool active_on); … … 356 362 bool m_showArrow; 357 363 358 364 bool m_overrideInactive; 365 int m_justify; 359 366 360 367 friend class UIListBtnType; 361 368 }; -
libs/libmyth/uilistbtntype.cpp
1705 1705 font = m_fontInactive; 1706 1706 p->setFont(font->face); 1707 1707 p->setPen(font->color); 1708 it.current()->setJustification(m_justify); 1708 1709 it.current()->paint(p, font, x, y, active_on); 1709 1710 font = m_active ? m_fontActive : m_fontInactive;; 1710 1711 p->setFont(font->face); … … 1712 1713 } 1713 1714 else 1714 1715 { 1716 it.current()->setJustification(m_justify); 1715 1717 it.current()->paint(p, font, x, y, active_on); 1716 1718 } 1717 1719 … … 1923 1925 1924 1926 ////////////////////////////////////////////////////////////////////////////// 1925 1927 1926 UIListBtnTypeItem::UIListBtnTypeItem(UIListBtnType* lbtype, const QString& text, 1927 QPixmap *pixmap, bool checkable, 1928 CheckState state, bool showArrow) 1928 UIListBtnTypeItem::UIListBtnTypeItem( 1929 UIListBtnType *parent, const QString &text, 1930 QPixmap *pixmap, bool checkable, 1931 CheckState state, bool showArrow) : 1932 m_parent(parent), m_text(QDeepCopy<QString>(text)), m_pixmap(pixmap), 1933 m_checkable(checkable), m_state(state), m_data(NULL), 1934 1935 m_checkRect(0,0,0,0), m_pixmapRect(0,0,0,0), 1936 m_textRect(0,0,0,0), m_arrowRect(0,0,0,0), 1937 1938 m_showArrow(showArrow), 1939 1940 m_overrideInactive(false), 1941 m_justify(Qt::AlignLeft | Qt::AlignVCenter) 1929 1942 { 1930 m_parent = lbtype;1931 m_text = text;1932 m_pixmap = pixmap;1933 m_checkable = checkable;1934 m_state = state;1935 m_showArrow = showArrow;1936 m_data = 0;1937 m_overrideInactive = false;1938 1939 1943 if (state >= NotChecked) 1940 1944 m_checkable = true; 1941 1945 … … 2153 2157 tr.moveBy(x,y); 2154 2158 QString text = m_parent->cutDown(m_text, &(font->face), false, 2155 2159 tr.width(), tr.height()); 2156 p->drawText(tr, Qt::AlignLeft|Qt::AlignVCenter, text);2160 p->drawText(tr, m_justify, text); 2157 2161 } 2158 2162 -
libs/libmyth/xmlparse.cpp
3447 3447 QRect area = QRect(0,0,0,0); 3448 3448 QString fontActive; 3449 3449 QString fontInactive; 3450 QString align = QString::null; 3450 3451 bool showArrow = true; 3451 3452 bool showScrollArrows = false; 3452 3453 int draworder = 0; … … 3507 3508 if (getFirstText(info).lower() == "no") 3508 3509 showArrow = false; 3509 3510 } 3511 else if (info.tagName() == "align") 3512 { 3513 align = getFirstText(info); 3514 } 3510 3515 else if (info.tagName() == "showscrollarrows") { 3511 3516 if (getFirstText(info).lower() == "yes") 3512 3517 showScrollArrows = true; … … 3558 3563 } 3559 3564 } 3560 3565 3566 int jst = Qt::AlignLeft | Qt::AlignVCenter; 3567 3568 if (!align.isEmpty()) 3569 { 3570 if (align.lower() == "center") 3571 jst = Qt::AlignCenter | Qt::AlignVCenter; 3572 else if (align.lower() == "right") 3573 jst = Qt::AlignRight | Qt::AlignVCenter; 3574 else if (align.lower() == "left") 3575 jst = Qt::AlignLeft | Qt::AlignVCenter; 3576 } 3577 3561 3578 fontProp *fpActive = GetFont(fontActive); 3562 3579 if (!fpActive) 3563 3580 { … … 3580 3597 l->SetScreen(wmult, hmult); 3581 3598 l->SetFontActive(fpActive); 3582 3599 l->SetFontInactive(fpInactive); 3600 l->SetJustification(jst); 3583 3601 l->SetItemRegColor(grUnselectedBeg, grUnselectedEnd, grUnselectedAlpha); 3584 3602 l->SetItemSelColor(grSelectedBeg, grSelectedEnd, grSelectedAlpha); 3585 3603 l->SetSpacing((int)(spacing*hmult)); -
libs/libmyth/mythcontext.h
209 209 210 210 /// Update this whenever the plug-in API changes. 211 211 /// Including changes in the libmythtv class methods used by plug-ins. 212 #define MYTH_BINARY_VERSION "0.21.2007112 2-1"212 #define MYTH_BINARY_VERSION "0.21.20071123-1" 213 213 214 214 /** \brief Increment this whenever the MythTV network protocol changes. 215 215 *