Commit f3c8f68f authored by Hugo Pereira Da Costa's avatar Hugo Pereira Da Costa
Browse files

added option "ViewInvertSortIndicator" to inverse the tree view sort indicator arrow direction.

CCBUG: 297807
parent 7225109b
......@@ -65,6 +65,7 @@ namespace Oxygen
_viewDrawTreeBranchLines( true ),
_viewDrawTriangularExpander( true ),
_viewTriangularExpanderSize( ArrowSmall ),
_viewInvertSortIndicator( false ),
_menuHighlightMode( MM_DARK ),
_windowDragEnabled( true ),
_windowDragMode( WD_FULL ),
......@@ -912,6 +913,9 @@ namespace Oxygen
else if( expanderSize == "TE_TINY" ) _viewTriangularExpanderSize = ArrowTiny;
else _viewTriangularExpanderSize = ArrowSmall;
// invert view sort indicators
_viewInvertSortIndicator = _oxygen.getOption( "[Style]", "ViewInvertSortIndicator" ).toVariant<std::string>("false") == "true";
// menu highlight mode
std::string highlightMode( _oxygen.getOption( "[Style]", "MenuHighlightMode" ).toVariant<std::string>("MM_DARK") );
if( highlightMode == "MM_SUBTLE" ) _menuHighlightMode = MM_SUBTLE;
......
......@@ -162,6 +162,10 @@ namespace Oxygen
ArrowSize viewTriangularExpanderSize( void ) const
{ return _viewTriangularExpanderSize; }
//! true if views sort order indicator arrow direction must be inverted
bool viewInvertSortIndicator( void ) const
{ return _viewInvertSortIndicator; }
//! menu highlight mode
enum MenuHighlightMode
{
......@@ -488,6 +492,9 @@ namespace Oxygen
//! triangular expander size
ArrowSize _viewTriangularExpanderSize;
//! true if views sort order indicator arrow direction must be inverted
bool _viewInvertSortIndicator;
//! menu highlight mode
MenuHighlightMode _menuHighlightMode;
......
......@@ -1852,7 +1852,7 @@ namespace Oxygen
// get arrow type
/* TODO: is it robust */
const GtkArrowType arrow( Gtk::gtk_arrow_get_type( angle ) );
GtkArrowType arrow( Gtk::gtk_arrow_get_type( angle ) );
// get arrow size (disregard the value passed as argument)
QtSettings::ArrowSize arrowSize( QtSettings::ArrowNormal );
......@@ -1959,23 +1959,29 @@ namespace Oxygen
data = Style::instance().animations().scrollBarStateEngine().get( widget, Gtk::gdk_rectangle( x, y, w, h ), arrow, options );
role = Palette::WindowText;
} else if(
Gtk::gtk_widget_path_has_type( path, GTK_TYPE_BUTTON ) &&
!Gtk::gtk_widget_path_has_type( path, GTK_TYPE_TREE_VIEW ) )
{
} else if( Gtk::gtk_widget_path_has_type( path, GTK_TYPE_BUTTON ) ) {
/* note: can't use gtk_theming_engine_has_class above, cause BUTTON is not passed */
useWidgetStateEngine = false;
options &= ~( Focus|Hover );
if( gtk_widget_path_is_type( path, GTK_TYPE_ARROW ) )
if( !Gtk::gtk_widget_path_has_type( path, GTK_TYPE_TREE_VIEW ) )
{
/* note: can't use gtk_theming_engine_has_class above, cause BUTTON is not passed */
useWidgetStateEngine = false;
options &= ~( Focus|Hover );
/* TODO: fixed margins for arrow buttons */
x += 1;
role = Palette::WindowText;
if( gtk_widget_path_is_type( path, GTK_TYPE_ARROW ) )
{
}
/* TODO: fixed margins for arrow buttons */
x += 1;
role = Palette::WindowText;
}
} else if( ( ( (parent = Gtk::gtk_parent_button( widget )) && Gtk::gtk_button_is_header( parent ) )
|| gtk_theming_engine_has_class( engine, GTK_STYLE_CLASS_HEADER )
|| gtk_theming_engine_has_region( engine, GTK_STYLE_REGION_COLUMN_HEADER, 0L ) ) &&
Style::instance().settings().viewInvertSortIndicator() )
{ arrow = (arrow == GTK_ARROW_UP ) ? GTK_ARROW_DOWN:GTK_ARROW_UP; }
} else if( gtk_theming_engine_has_class( engine, GTK_STYLE_CLASS_CALENDAR ) ) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment