Added support for Right To Left layout direction and also themes support RTL!
BIN
bin/themes/chrome/images/gotoaddress_rtl.png
Normal file
After Width: | Height: | Size: 645 B |
14
bin/themes/chrome/rtl.css
Normal file
|
@ -0,0 +1,14 @@
|
|||
#navigation-button-next
|
||||
{
|
||||
qproperty-multiIcon: url(images/navigation-back.png);
|
||||
}
|
||||
|
||||
#navigation-button-back
|
||||
{
|
||||
qproperty-multiIcon: url(images/navigation-forward.png);
|
||||
}
|
||||
|
||||
#locationbar-goicon
|
||||
{
|
||||
qproperty-pixmap: url(images/gotoaddress_rtl.png);
|
||||
}
|
BIN
bin/themes/default/images/gotoaddress_rtl.png
Normal file
After Width: | Height: | Size: 645 B |
14
bin/themes/default/rtl.css
Normal file
|
@ -0,0 +1,14 @@
|
|||
#navigation-button-next
|
||||
{
|
||||
qproperty-icon: url(images/navigation-back.png);
|
||||
}
|
||||
|
||||
#navigation-button-back
|
||||
{
|
||||
qproperty-icon: url(images/navigation-forward.png);
|
||||
}
|
||||
|
||||
#locationbar-goicon
|
||||
{
|
||||
qproperty-pixmap: url(images/gotoaddress_rtl.png);
|
||||
}
|
BIN
bin/themes/linux/images/gotoaddress_rtl.png
Normal file
After Width: | Height: | Size: 645 B |
16
bin/themes/linux/rtl.css
Normal file
|
@ -0,0 +1,16 @@
|
|||
#navigation-button-next
|
||||
{
|
||||
qproperty-themeIcon: "go-previous";
|
||||
qproperty-fallbackIcon: url(images/go-previous.png);
|
||||
}
|
||||
|
||||
#navigation-button-back
|
||||
{
|
||||
qproperty-themeIcon: "go-next";
|
||||
qproperty-fallbackIcon: url(images/go-next.png);
|
||||
}
|
||||
|
||||
#locationbar-goicon
|
||||
{
|
||||
qproperty-pixmap: url(images/gotoaddress_rtl.png);
|
||||
}
|
BIN
bin/themes/mac/images/tabs-list-button_rtl.png
Normal file
After Width: | Height: | Size: 350 B |
19
bin/themes/mac/rtl.css
Normal file
|
@ -0,0 +1,19 @@
|
|||
#navigation-button-next
|
||||
{
|
||||
qproperty-multiIcon: url(images/navigation-back.png);
|
||||
}
|
||||
|
||||
#navigation-button-back
|
||||
{
|
||||
qproperty-multiIcon: url(images/navigation-forward.png);
|
||||
}
|
||||
|
||||
#tabwidget-button-opentabs
|
||||
{
|
||||
qproperty-multiIcon: url(images/tabs-list-button_rtl.png);
|
||||
}
|
||||
|
||||
#locationbar-goicon
|
||||
{
|
||||
qproperty-pixmap: url(images/gotoaddress_rtl.png);
|
||||
}
|
BIN
bin/themes/windows/images/gotoaddress_rtl.png
Normal file
After Width: | Height: | Size: 645 B |
BIN
bin/themes/windows/images/tabbar-addtab_rtl.png
Normal file
After Width: | Height: | Size: 927 B |
BIN
bin/themes/windows/images/tabs-list-button_rtl.png
Normal file
After Width: | Height: | Size: 704 B |
24
bin/themes/windows/rtl.css
Normal file
|
@ -0,0 +1,24 @@
|
|||
#navigation-button-next
|
||||
{
|
||||
qproperty-multiIcon: url(images/navigation-back.png);
|
||||
}
|
||||
|
||||
#navigation-button-back
|
||||
{
|
||||
qproperty-multiIcon: url(images/navigation-forward.png);
|
||||
}
|
||||
|
||||
#tabwidget-button-opentabs
|
||||
{
|
||||
qproperty-multiIcon: url(images/tabs-list-button_rtl.png);
|
||||
}
|
||||
|
||||
#tabwidget-button-addtab
|
||||
{
|
||||
qproperty-multiIcon: url(images/tabbar-addtab_rtl.png);
|
||||
}
|
||||
|
||||
#locationbar-goicon
|
||||
{
|
||||
qproperty-pixmap: url(images/gotoaddress_rtl.png);
|
||||
}
|
|
@ -301,6 +301,15 @@ void MainApplication::loadSettings()
|
|||
}
|
||||
#endif
|
||||
|
||||
//RTL Support
|
||||
//loading 'rtl.css' when layout is right to left!
|
||||
if ( isRightToLeft() && QFile(m_activeThemePath + "rtl.css").exists()) {
|
||||
cssFile.setFileName(m_activeThemePath + "rtl.css");
|
||||
cssFile.open(QFile::ReadOnly);
|
||||
css.append(cssFile.readAll());
|
||||
cssFile.close();
|
||||
}
|
||||
|
||||
QString relativePath = QDir::current().relativeFilePath(m_activeThemePath);
|
||||
css.replace(QRegExp("url\\s*\\(\\s*([^\\*:\\);]+)\\s*\\)", Qt::CaseSensitive, QRegExp::RegExp2),
|
||||
QString("url(%1\\1)").arg(relativePath + "/"));
|
||||
|
|
|
@ -169,10 +169,22 @@ QIcon IconProvider::standardIcon(QStyle::StandardPixmap icon)
|
|||
return QIcon(":/icons/faenza/reload.png");
|
||||
|
||||
case QStyle::SP_ArrowForward:
|
||||
return QIcon(":/icons/faenza/forward.png");
|
||||
//RTL Support
|
||||
if (QApplication::layoutDirection() == Qt::RightToLeft) {
|
||||
return QIcon(":/icons/faenza/back.png");
|
||||
}
|
||||
else {
|
||||
return QIcon(":/icons/faenza/forward.png");
|
||||
}
|
||||
|
||||
case QStyle::SP_ArrowBack:
|
||||
return QIcon(":/icons/faenza/back.png");
|
||||
//RTL Support
|
||||
if (QApplication::layoutDirection() == Qt::RightToLeft) {
|
||||
return QIcon(":/icons/faenza/forward.png");
|
||||
}
|
||||
else {
|
||||
return QIcon(":/icons/faenza/back.png");
|
||||
}
|
||||
|
||||
default:
|
||||
return QIcon();
|
||||
|
|
|
@ -217,6 +217,10 @@ QSize TabBar::tabSizeHint(int index) const
|
|||
if (m_adjustingLastTab) {
|
||||
xForAddTabButton += m_lastTabWidth - m_normalTabWidth;
|
||||
}
|
||||
//RTL Support
|
||||
if (QApplication::layoutDirection() == Qt::RightToLeft) {
|
||||
xForAddTabButton = width() - xForAddTabButton;
|
||||
}
|
||||
emit tabBar->moveAddTabButton(xForAddTabButton);
|
||||
}
|
||||
|
||||
|
|
|
@ -163,7 +163,13 @@ void TabWidget::resizeEvent(QResizeEvent* e)
|
|||
{
|
||||
QPoint posit;
|
||||
posit.setY(0);
|
||||
posit.setX(width() - m_buttonListTabs->width());
|
||||
//RTL Support
|
||||
if (QApplication::layoutDirection() == Qt::RightToLeft) {
|
||||
posit.setX(0);
|
||||
}
|
||||
else {
|
||||
posit.setX(width() - m_buttonListTabs->width());
|
||||
}
|
||||
m_buttonListTabs->move(posit);
|
||||
|
||||
QTabWidget::resizeEvent(e);
|
||||
|
@ -194,6 +200,10 @@ void TabWidget::hideButtons()
|
|||
void TabWidget::moveAddTabButton(int posX)
|
||||
{
|
||||
int posY = (m_tabBar->height() - m_buttonAddTab->height()) / 2;
|
||||
//RTL Support
|
||||
if (QApplication::layoutDirection() == Qt::RightToLeft) {
|
||||
posX = posX - m_buttonAddTab->width();
|
||||
}
|
||||
m_buttonAddTab->move(posX, posY);
|
||||
}
|
||||
|
||||
|
|