Ticket #4885: osd.rtl.v5.patch
File osd.rtl.v5.patch, 4.7 KB (added by , 15 years ago) |
---|
-
mythtv/libs/libmythtv/osdlistbtntype.cpp
65 65 m_hmult = (hmult == 0.0f) ? 1.0f : hmult; 66 66 m_unbiasedarea = unbias(area, wmult, hmult); 67 67 m_unbiasedsize = unbias(levelsize, wmult, hmult); 68 69 if (gContext->GetLanguage()=="he") 70 m_isRtl = true; 71 else 72 m_isRtl = false; 68 73 } 69 74 70 75 OSDListTreeType::~OSDListTreeType() … … 140 145 { 141 146 QString levelname = QString("level%1").arg(i + 1); 142 147 QRect curlevelarea = m_levelsize; 143 curlevelarea.moveBy(m_totalarea.x(), m_totalarea.y()); 144 curlevelarea.moveBy((m_levelsize.width() + m_levelspacing) * i, 0); 148 149 // if we are left to right 150 if (false == m_isRtl) 151 { 152 curlevelarea.moveBy(m_totalarea.x(), m_totalarea.y()); 153 curlevelarea.moveBy((m_levelsize.width() + m_levelspacing) * i, 0); 154 } 155 156 // if we are right to left 157 else 158 { 159 curlevelarea.moveBy(m_totalarea.width(), m_totalarea.y()); 160 curlevelarea.moveBy( ((-1 - i) * m_levelsize.width()) - m_levelspacing,0); 161 } 145 162 146 163 OSDListBtnType *newlevel = new OSDListBtnType( 147 164 levelname, curlevelarea, m_wmult, m_hmult, true); … … 214 231 GetLevel(m_levelnum)->MovePageDown(); 215 232 EnterItem(); 216 233 } 217 else if ( has_action("LEFT", actions) && (m_levelnum > 0))234 else if (!m_isRtl && has_action("LEFT", actions) && (m_levelnum > 0)) 218 235 { 219 236 GetLevel(m_levelnum)->Reset(); 220 237 GetLevel(m_levelnum)->SetVisible(false); … … 222 239 m_levelnum--; 223 240 EnterItem(); 224 241 } 225 else if ((has_action("LEFT", actions) && m_arrowAccel) || 242 else if (m_isRtl && has_action("LEFT",actions)) 243 { 244 // Right to left - left acts as select / advance one stage 245 if ((m_levelnum + 1 < m_depth) && 246 (currentpos->childCount() > 0)) 247 { 248 GetLevel(m_levelnum)->SetActive(false); 249 m_levelnum++; 250 251 FillLevelFromTree(currentpos, m_levelnum); 252 GetLevel(m_levelnum)->SetVisible(true); 253 EnterItem(); 254 } 255 else 256 { 257 SelectItem(); 258 } 259 } 260 else if ((!m_isRtl && has_action("LEFT", actions) && m_arrowAccel) || 226 261 has_action("ESCAPE", actions) || 227 262 has_action("CLEAROSD", actions) || 228 263 has_action("MENU", actions)) 229 264 { 230 265 m_visible = false; 231 266 } 232 else if ( has_action("RIGHT", actions) &&267 else if (!m_isRtl && has_action("RIGHT", actions) && 233 268 (m_levelnum + 1 < m_depth) && 234 269 (currentpos->childCount() > 0)) 235 270 { … … 240 275 GetLevel(m_levelnum)->SetVisible(true); 241 276 EnterItem(); 242 277 } 243 else if (( has_action("RIGHT", actions) && m_arrowAccel) ||278 else if ((!m_isRtl && has_action("RIGHT", actions) && m_arrowAccel) || 244 279 has_action("SELECT", actions)) 245 280 { 246 281 SelectItem(); 247 282 } 283 else if ((true ==m_isRtl) && has_action("RIGHT",actions) && (m_levelnum > 0)) 284 { 285 GetLevel(m_levelnum)->Reset(); 286 GetLevel(m_levelnum)->SetVisible(false); 287 288 m_levelnum--; 289 EnterItem(); 290 } 291 248 292 else 249 293 { 250 294 return false; … … 662 706 LoadPixmap(m_checkNonePix, "check-empty"); 663 707 LoadPixmap(m_checkHalfPix, "check-half"); 664 708 LoadPixmap(m_checkFullPix, "check-full"); 665 LoadPixmap(m_arrowPix, "arrow"); 709 if (gContext->GetLanguage()=="he") 710 LoadPixmap(m_arrowPix, "ltarrow"); 711 else 712 LoadPixmap(m_arrowPix, "arrow"); 666 713 667 714 uint itemWidth = (m_rect.width() + 1) & (~1); 668 715 … … 751 798 if (m_checkable) 752 799 m_checkRect = QRect(margin, (height - ch)/2, cw, ch); 753 800 754 if (m_showArrow) 755 m_arrowRect = QRect(width - aw - margin, (height - ah)/2, aw, ah); 801 if (m_showArrow) 802 if (gContext->GetLanguage() == "he") 803 m_arrowRect = QRect(m_parent->m_contentsRect.x() + margin, (height - ah)/2, aw, ah); 804 else 805 m_arrowRect = QRect(width - aw - margin, (height - ah)/2, aw, ah); 806 756 807 757 808 if (m_pixmap) 758 809 { … … 765 816 tx += (m_pixmap) ? m_pixmapRect.width() + margin : 0; 766 817 tw -= (m_checkable) ? m_checkRect.width() + margin : 0; 767 818 tw -= (m_showArrow) ? m_arrowRect.width() + margin : 0; 819 820 if (gContext->GetLanguage()=="he") 821 tx += (m_showArrow) ? m_arrowRect.width() + margin : 0; 822 768 823 tw -= (m_pixmap) ? m_pixmapRect.width() + margin : 0; 769 824 m_textRect = QRect(tx, 0, tw, height); 770 825 rtl=new RTL(); -
mythtv/libs/libmythtv/osdlistbtntype.h
152 152 int m_levelnum; 153 153 bool m_visible; 154 154 bool m_arrowAccel; 155 bool m_isRtl; 155 156 }; 156 157 157 158 class OSDListBtnType : public OSDType