commit oxygen-gtk3 for openSUSE:Factory
Hello community, here is the log from the commit of package oxygen-gtk3 for openSUSE:Factory checked in at 2012-07-24 15:32:07 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/oxygen-gtk3 (Old) and /work/SRC/openSUSE:Factory/.oxygen-gtk3.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "oxygen-gtk3", Maintainer is "" Changes: -------- --- /work/SRC/openSUSE:Factory/oxygen-gtk3/oxygen-gtk3.changes 2012-06-25 11:53:01.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.oxygen-gtk3.new/oxygen-gtk3.changes 2012-07-24 17:20:18.000000000 +0200 @@ -1,0 +2,8 @@ +Sat Jul 21 13:00:00 UTC 2012 - asterios.dramis@gmail.com + +- Update to version 1.1.0: + * Many improvement for libreoffice, tied to its next release + (libreoffice v3.6). + * Fix of most rendering issues introduced with the release of gtk+-3.4. + +------------------------------------------------------------------- Old: ---- oxygen-gtk3-1.0.5.tar.bz2 New: ---- oxygen-gtk3-1.1.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ oxygen-gtk3.spec ++++++ --- /var/tmp/diff_new_pack.YmH2th/_old 2012-07-24 17:20:21.000000000 +0200 +++ /var/tmp/diff_new_pack.YmH2th/_new 2012-07-24 17:20:21.000000000 +0200 @@ -17,7 +17,7 @@ Name: oxygen-gtk3 -Version: 1.0.5 +Version: 1.1.0 Release: 0 Summary: A Port of the default KDE Widget Theme (Oxygen), to GTK 3.x License: LGPL-2.1+ ++++++ oxygen-gtk3-1.0.5.tar.bz2 -> oxygen-gtk3-1.1.0.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.0.5/CMakeLists.txt new/oxygen-gtk3-1.1.0/CMakeLists.txt --- old/oxygen-gtk3-1.0.5/CMakeLists.txt 2012-06-15 08:46:03.000000000 +0200 +++ new/oxygen-gtk3-1.1.0/CMakeLists.txt 2012-07-16 19:17:32.000000000 +0200 @@ -12,8 +12,8 @@ set( CPACK_PACKAGE_DESCRIPTION_SUMMARY "Oxygen Gtk3 theme" ) set( CPACK_PACKAGE_VENDOR "hugo@oxygen-icons.org" ) set( CPACK_PACKAGE_VERSION_MAJOR "1" ) -set( CPACK_PACKAGE_VERSION_MINOR "0" ) -set( CPACK_PACKAGE_VERSION_PATCH "5" ) +set( CPACK_PACKAGE_VERSION_MINOR "1" ) +set( CPACK_PACKAGE_VERSION_PATCH "0" ) set( CPACK_SOURCE_IGNORE_FILES "build" "^${PROJECT_SOURCE_DIR}.*/.git/" ) ################################## @@ -114,9 +114,9 @@ # installation directories ########################## exec_program( - ${PKGCONFIG_EXECUTABLE} - ARGS --variable=gtk_binary_version gtk+-3.0 - OUTPUT_VARIABLE GTK_BIN_VERSION ) + ${PKGCONFIG_EXECUTABLE} + ARGS --variable=gtk_binary_version gtk+-3.0 + OUTPUT_VARIABLE GTK_BIN_VERSION ) if( DEFINED LIB_SUFFIX OR NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.0.5/README new/oxygen-gtk3-1.1.0/README --- old/oxygen-gtk3-1.0.5/README 2012-06-15 08:46:03.000000000 +0200 +++ new/oxygen-gtk3-1.1.0/README 2012-07-16 19:17:32.000000000 +0200 @@ -81,6 +81,7 @@ OXYGEN_DISABLE_ARGB_HACK - set it to 1 to check if app will crash without the hack. Oxygen-GTK will print app name to report. OXYGEN_ARGB_DEBUG - set it to 1 to print all debug information concerning ARGB hack (mainly to debug blacklist logic). + OXYGEN_DISABLE_INNER_SHADOWS_HACK - set it to 1 to disable inner shadows hack, which might make some widgets render in a wrong way or not render at all III.2 DBus support ------------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.0.5/TODO new/oxygen-gtk3-1.1.0/TODO --- old/oxygen-gtk3-1.0.5/TODO 2012-06-15 08:46:03.000000000 +0200 +++ new/oxygen-gtk3-1.1.0/TODO 2012-07-16 19:17:32.000000000 +0200 @@ -73,4 +73,3 @@ Also use composited child hack to round combobox list (and remove old XShape hack for this) Apply XShape to GtkEntry and GtkComboboxEntry to make it look better on non-oxygen background (e.g. in GtkTextView) ->>>>>>> master diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.0.5/demo/oxygengtkdeco_main.cpp new/oxygen-gtk3-1.1.0/demo/oxygengtkdeco_main.cpp --- old/oxygen-gtk3-1.0.5/demo/oxygengtkdeco_main.cpp 2012-06-15 08:46:03.000000000 +0200 +++ new/oxygen-gtk3-1.1.0/demo/oxygengtkdeco_main.cpp 2012-07-16 19:17:32.000000000 +0200 @@ -301,6 +301,15 @@ } //___________________________________________________________________ +gboolean on_press0(GtkWindow* window, GdkEventButton* event, GdkWindowEdge edge) +{ + if(event->type == GDK_BUTTON_PRESS) + if(event->button == 1) + gtk_window_begin_move_drag(window,event->button,event->x_root,event->y_root,event->time); + return FALSE; +} + +//___________________________________________________________________ int main(int argc, char** argv) { @@ -325,12 +334,14 @@ gtk_window_set_default_size( GTK_WINDOW(mw1), ww, wh ); gtk_window_set_default_size( GTK_WINDOW(mw0), ww+dw, wh+dh ); gtk_window_set_decorated(GTK_WINDOW(mw0), FALSE); + gtk_widget_add_events(mw0,GDK_BUTTON_PRESS_MASK); gtk_window_set_title( GTK_WINDOW(mw1), "This is a caption"); g_signal_connect( G_OBJECT(mw0), "expose-event", G_CALLBACK(on_expose), 0L); g_signal_connect( G_OBJECT(mw1), "configure-event", G_CALLBACK(on_configure1), 0L); g_signal_connect( G_OBJECT(mw0), "configure-event", G_CALLBACK(on_configure0), 0L); + g_signal_connect( G_OBJECT(mw0), "button-press-event", G_CALLBACK(on_press0), NULL); gtk_widget_show( mw1 ); gtk_widget_show( mw0 ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.0.5/demo/oxygensliderdemowidget.cpp new/oxygen-gtk3-1.1.0/demo/oxygensliderdemowidget.cpp --- old/oxygen-gtk3-1.0.5/demo/oxygensliderdemowidget.cpp 2012-06-15 08:46:03.000000000 +0200 +++ new/oxygen-gtk3-1.1.0/demo/oxygensliderdemowidget.cpp 2012-07-16 19:17:32.000000000 +0200 @@ -62,7 +62,6 @@ // scale _horizontalSliders._scale = gtk_scale_new_with_range( GTK_ORIENTATION_HORIZONTAL, 0, 100, 1 ); gtk_scale_set_draw_value( GTK_SCALE( _horizontalSliders._scale ), false ); - gtk_range_set_value( GTK_RANGE( _horizontalSliders._scale ), 25 ); gtk_box_pack_start( GTK_BOX( box ), _horizontalSliders._scale, false, true, 0 ); gtk_widget_show( _horizontalSliders._scale ); @@ -70,15 +69,14 @@ // progress entry _horizontalSliders._progressEntry = gtk_entry_new(); gtk_entry_set_text( GTK_ENTRY( _horizontalSliders._progressEntry ), "Progress Bar Entry" ); - gtk_entry_set_progress_fraction( GTK_ENTRY( _horizontalSliders._progressEntry ), 0.25 ); gtk_box_pack_start( GTK_BOX( box ), _horizontalSliders._progressEntry, false, true, 0 ); gtk_widget_show( _horizontalSliders._progressEntry ); // progress bar _horizontalSliders._progressBar = gtk_progress_bar_new(); + gtk_progress_bar_set_show_text( GTK_PROGRESS_BAR( _horizontalSliders._progressBar ), true ); gtk_orientable_set_orientation( GTK_ORIENTABLE( _horizontalSliders._progressBar ), GTK_ORIENTATION_HORIZONTAL ); - gtk_progress_bar_set_fraction( GTK_PROGRESS_BAR( _horizontalSliders._progressBar ), 0.25 ); gtk_box_pack_start( GTK_BOX( box ), _horizontalSliders._progressBar, false, true, 0 ); gtk_widget_show( _horizontalSliders._progressBar ); @@ -116,16 +114,14 @@ // scale _verticalSliders._scale = gtk_scale_new_with_range( GTK_ORIENTATION_VERTICAL, 0, 100, 1 ); gtk_scale_set_draw_value( GTK_SCALE( _verticalSliders._scale ), false ); - gtk_range_set_value( GTK_RANGE( _verticalSliders._scale ), 25 ); gtk_box_pack_start( GTK_BOX( box ), _verticalSliders._scale, false, true, 0 ); gtk_widget_show( _verticalSliders._scale ); // progress bar _verticalSliders._progressBar = gtk_progress_bar_new(); + gtk_progress_bar_set_show_text( GTK_PROGRESS_BAR( _verticalSliders._progressBar ), true ); gtk_orientable_set_orientation( GTK_ORIENTABLE( _verticalSliders._progressBar ), GTK_ORIENTATION_VERTICAL ); - // gtk_progress_set_show_text( GTK_PROGRESS( _verticalSliders._progressBar ), true ); - gtk_progress_bar_set_fraction( GTK_PROGRESS_BAR( _verticalSliders._progressBar ), 0.25 ); gtk_box_pack_start( GTK_BOX( box ), _verticalSliders._progressBar, false, true, 0 ); gtk_widget_show( _verticalSliders._progressBar ); @@ -140,6 +136,8 @@ _horizontalSliders.connect( GCallback( valueChanged ), this ); _verticalSliders.connect( GCallback( valueChanged ), this ); + // Initialize all + gtk_range_set_value( GTK_RANGE( _verticalSliders._scale ), 25 ); } //____________________________________________________ @@ -166,6 +164,7 @@ //____________________________________________________ void SliderDemoWidget::Sliders::setValue( const double& value ) const { + gtk_range_set_value( GTK_RANGE( _scale ), value ); gtk_progress_bar_set_fraction( GTK_PROGRESS_BAR( _progressBar ), value/100 ); gtk_range_set_value( GTK_RANGE( _scrollBar ), value ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.0.5/rc/gtk.css new/oxygen-gtk3-1.1.0/rc/gtk.css --- old/oxygen-gtk3-1.0.5/rc/gtk.css 2012-06-15 08:46:03.000000000 +0200 +++ new/oxygen-gtk3-1.1.0/rc/gtk.css 2012-07-16 19:17:32.000000000 +0200 @@ -18,6 +18,26 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ +/* +hard coded colors for infobars +these used to have valid default values set by Gtk, +but is not the case anymore. +TODO: use the same colors as KDE's message boxes +*/ + +@define-color info_fg_color black; +@define-color info_bg_color rgb (252, 252, 189); + +@define-color warning_fg_color black; +@define-color warning_bg_color rgb (250, 173, 61); + +@define-color question_fg_color white; +@define-color question_bg_color rgb (138, 173, 212); + +@define-color error_fg_color white; +@define-color error_bg_color rgb (237, 54, 54); + + /* INFO: css border and padding ordering is either: @@ -129,6 +149,11 @@ GtkProgressBar { padding: 0px; } GtkAssistant .sidebar { padding: 4px; } +GtkInfoBar { + border-style: solid; + border-width: 8px; +} + /* switchs */ GtkSwitch { padding: 0px; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.0.5/rc/kdeglobals new/oxygen-gtk3-1.1.0/rc/kdeglobals --- old/oxygen-gtk3-1.0.5/rc/kdeglobals 2012-06-15 08:46:03.000000000 +0200 +++ new/oxygen-gtk3-1.1.0/rc/kdeglobals 2012-07-16 19:17:32.000000000 +0200 @@ -10,17 +10,17 @@ [ColorEffects:Inactive] ChangeSelectionColor=true Color=112,111,110 -ColorAmount=0.025 -ColorEffect=2 -ContrastAmount=0.1 +ColorAmount=-0.9 +ColorEffect=1 +ContrastAmount=0.25 ContrastEffect=2 -Enable=true +Enable=false IntensityAmount=0 IntensityEffect=0 [Colors:Button] BackgroundAlternate=224,223,222 -BackgroundNormal=207,204,201 +BackgroundNormal=223,220,217 DecorationFocus=58,167,221 DecorationHover=110,214,255 ForegroundActive=255,128,224 @@ -28,7 +28,7 @@ ForegroundLink=0,87,174 ForegroundNegative=191,3,3 ForegroundNeutral=176,128,0 -ForegroundNormal=27,25,24 +ForegroundNormal=34,31,30 ForegroundPositive=0,110,40 ForegroundVisited=100,74,155 @@ -48,7 +48,7 @@ [Colors:Tooltip] BackgroundAlternate=196,224,255 -BackgroundNormal=190,223,255 +BackgroundNormal=24,21,19 DecorationFocus=58,167,221 DecorationHover=110,214,255 ForegroundActive=255,128,224 @@ -56,7 +56,7 @@ ForegroundLink=0,87,174 ForegroundNegative=191,3,3 ForegroundNeutral=176,128,0 -ForegroundNormal=37,35,33 +ForegroundNormal=231,253,255 ForegroundPositive=0,110,40 ForegroundVisited=100,74,155 @@ -70,13 +70,13 @@ ForegroundLink=0,87,174 ForegroundNegative=191,3,3 ForegroundNeutral=176,128,0 -ForegroundNormal=24,22,21 +ForegroundNormal=31,28,27 ForegroundPositive=0,110,40 ForegroundVisited=100,74,155 [Colors:Window] BackgroundAlternate=218,217,216 -BackgroundNormal=213,209,207 +BackgroundNormal=214,210,208 DecorationFocus=58,167,221 DecorationHover=110,214,255 ForegroundActive=255,128,224 @@ -84,13 +84,12 @@ ForegroundLink=0,87,174 ForegroundNegative=191,3,3 ForegroundNeutral=176,128,0 -ForegroundNormal=27,25,24 +ForegroundNormal=34,31,30 ForegroundPositive=0,110,40 ForegroundVisited=100,74,155 [General] Name=Oxygen -shadeSortColumn=true [KDE] contrast=8 @@ -103,12 +102,6 @@ inactiveBackground=224,223,222 inactiveForeground=75,71,67 -[General] -ColorScheme=Oxygen -XftHintStyle=hintfull -shadeSortColumn=true -widgetStyle=oxygen - [Toolbar style] ToolButtonStyle=TextBesideIcon ToolButtonStyleOtherToolbars=TextBesideIcon diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.0.5/src/animations/oxygenanimations.cpp new/oxygen-gtk3-1.1.0/src/animations/oxygenanimations.cpp --- old/oxygen-gtk3-1.0.5/src/animations/oxygenanimations.cpp 2012-06-15 08:46:03.000000000 +0200 +++ new/oxygen-gtk3-1.1.0/src/animations/oxygenanimations.cpp 2012-07-16 19:17:32.000000000 +0200 @@ -140,7 +140,8 @@ _backgroundHintHook.connect( "realize", (GSignalEmissionHook)backgroundHintHook, this ); #if ENABLE_INNER_SHADOWS_HACK - _innerShadowHook.connect( "realize", (GSignalEmissionHook)innerShadowHook, this ); + if(!getenv("OXYGEN_DISABLE_INNER_SHADOWS_HACK")) + _innerShadowHook.connect( "realize", (GSignalEmissionHook)innerShadowHook, this ); #endif _sizeAllocationHook.connect( "size-allocate", (GSignalEmissionHook)sizeAllocationHook, this ); @@ -231,6 +232,22 @@ return TRUE; } + #if GTK_CHECK_VERSION( 3, 5, 0 ) + /* + HACK: Somehow, style_updated method for GtkRange widgets is not called anymore + as soon as we (oxygen-gtk) install our hooks. This prevents some settings to be + properly initialized, such as the slider length, or the arrows for scrollbars. + Therefore we explicitly call the styleUpdated function ourselves. + */ + if( GTK_IS_RANGE( widget ) ) + { + // get class + GtkWidgetClass* widgetClass = GTK_WIDGET_GET_CLASS( widget ); + if( widgetClass && widgetClass->style_updated ) + { (*widgetClass->style_updated)(widget); } + } + #endif + // groupbox labels #if ENABLE_GROUPBOX_HACK if( static_cast<Animations*>( data )->groupBoxLabelEngine().contains( widget ) ) @@ -276,26 +293,28 @@ << std::endl; #endif + int uglyShadowWidth=!Gtk::gdk_default_screen_is_composited(); + // perform move-resize if( widthChanged && positionChanged ) { gdk_window_move_resize( gtk_widget_get_window( widget ), - targetX + comboAllocation.x + 3, sourceY, - comboAllocation.width - 6, widgetAllocation.height ); + targetX + comboAllocation.x + 3 - uglyShadowWidth, sourceY, + comboAllocation.width - 6 + 2*uglyShadowWidth, widgetAllocation.height ); } else if( widthChanged ) { gdk_window_resize( gtk_widget_get_window( widget ), - comboAllocation.width - 6, widgetAllocation.height ); + comboAllocation.width - 6 + 2*uglyShadowWidth, widgetAllocation.height ); } else if( positionChanged ) { gdk_window_move( gtk_widget_get_window( widget ), - targetX + comboAllocation.x + 3, sourceY ); + targetX + comboAllocation.x + 3 - uglyShadowWidth, sourceY ); } @@ -335,7 +354,6 @@ Animations& animations( *static_cast<Animations*>(data) ); if( !animations.innerShadowsEnabled() ) return TRUE; - if( Gtk::gtk_combobox_is_tree_view( widget ) ) return TRUE; if( Gtk::g_object_is_a( G_OBJECT( widget ), "SwtFixed" ) ) return TRUE; GtkWidget* parent(gtk_widget_get_parent(widget)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.0.5/src/animations/oxygencomboboxdata.cpp new/oxygen-gtk3-1.1.0/src/animations/oxygencomboboxdata.cpp --- old/oxygen-gtk3-1.0.5/src/animations/oxygencomboboxdata.cpp 2012-06-15 08:46:03.000000000 +0200 +++ new/oxygen-gtk3-1.1.0/src/animations/oxygencomboboxdata.cpp 2012-07-16 19:17:32.000000000 +0200 @@ -122,7 +122,10 @@ { // change background color if( _cell._widget ) - { gtk_cell_view_set_background_color( GTK_CELL_VIEW( _cell._widget ), 0L ); } + { + const GdkRGBA color = { 0, 0, 0, 0 }; + gtk_cell_view_set_background_rgba( GTK_CELL_VIEW( _cell._widget ), &color ); + } } //________________________________________________________________________________ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.0.5/src/animations/oxygendialogengine.cpp new/oxygen-gtk3-1.1.0/src/animations/oxygendialogengine.cpp --- old/oxygen-gtk3-1.0.5/src/animations/oxygendialogengine.cpp 2012-06-15 08:46:03.000000000 +0200 +++ new/oxygen-gtk3-1.1.0/src/animations/oxygendialogengine.cpp 2012-07-16 19:17:32.000000000 +0200 @@ -73,12 +73,17 @@ #if OXYGEN_DEBUG std::cerr << "DialogEngine::registerWidget - numOfResponsesFound: " << numOfResponsesFound << std::endl; - for(int i=0; i<numOfResponseIDs; i++) - { - std::cerr << Gtk::TypeNames::response( responses[i] ) << ", "; - if(i==numOfResponsesFound-1) std::cerr<<"_END_of_found_,"; - } - std::cerr << "\n\n"; + std::cerr << "List of responses found: { "; + + for(int i=0; i<numOfResponsesFound; i++) + { std::cerr << Gtk::TypeNames::response( responses[i] ) << (i==numOfResponsesFound-1 ? " " :", "); } + + std::cerr << "}; remaining in the list: { "; + + for(int i=numOfResponsesFound; i<numOfResponseIDs; i++) + { std::cerr << Gtk::TypeNames::response( responses[i] ) << (i==numOfResponseIDs-1 ? " " :", "); } + + std::cerr << "}\n"; #endif // change order diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.0.5/src/animations/oxygeninnershadowdata.cpp new/oxygen-gtk3-1.1.0/src/animations/oxygeninnershadowdata.cpp --- old/oxygen-gtk3-1.0.5/src/animations/oxygeninnershadowdata.cpp 2012-06-15 08:46:03.000000000 +0200 +++ new/oxygen-gtk3-1.1.0/src/animations/oxygeninnershadowdata.cpp 2012-07-16 19:17:32.000000000 +0200 @@ -24,6 +24,7 @@ #include "../oxygengtkutils.h" #include "../config.h" #include "../oxygencairocontext.h" +#include "../oxygencairoutils.h" #include "oxygenanimations.h" #include "../oxygenstyle.h" #include "../oxygenmetrics.h" @@ -85,6 +86,8 @@ void InnerShadowData::registerChild( GtkWidget* widget ) { + #if ENABLE_INNER_SHADOWS_HACK + // make sure widget is not already in map if( _childrenData.find( widget ) != _childrenData.end() ) return; @@ -111,11 +114,14 @@ _childrenData.insert( std::make_pair( widget, data ) ); } + #endif + } //________________________________________________________________________________ void InnerShadowData::unregisterChild( GtkWidget* widget ) { + #if ENABLE_INNER_SHADOWS_HACK ChildDataMap::iterator iter( _childrenData.find( widget ) ); if( iter == _childrenData.end() ) return; @@ -130,11 +136,13 @@ iter->second.disconnect( widget ); _childrenData.erase( iter ); + #endif } //________________________________________________________________________________ void InnerShadowData::ChildData::disconnect( GtkWidget* widget ) { + #if ENABLE_INNER_SHADOWS_HACK // disconnect signals _unrealizeId.disconnect(); @@ -153,6 +161,8 @@ // restore compositing if different from initial state if( GDK_IS_WINDOW( window ) && !gdk_window_is_destroyed(window) && gdk_window_get_composited( window ) != _initiallyComposited ) { gdk_window_set_composited( window, _initiallyComposited ); } + + #endif } //____________________________________________________________________________________________ @@ -172,6 +182,7 @@ gboolean InnerShadowData::targetExposeEvent( GtkWidget* widget, GdkEventExpose* event, gpointer ) { + #if ENABLE_INNER_SHADOWS_HACK GtkWidget* child( gtk_bin_get_child( GTK_BIN( widget ) ) ); GdkWindow* window( gtk_widget_get_window( widget ) ); GdkWindow* childWindow( gtk_widget_get_window( child ) ); @@ -219,6 +230,40 @@ cairo_fill(context); #endif + // Render rounded combobox list child + if(Gtk::gtk_combobox_is_tree_view( child )) + { + StyleOptions options(widget,gtk_widget_get_state(widget)); + Corners corners(CornersAll); + if(gtk_widget_get_visible(gtk_scrolled_window_get_vscrollbar(GTK_SCROLLED_WINDOW(widget)))) + { + if(Gtk::gtk_widget_layout_is_reversed( widget )) + corners &= ~CornersLeft; + else + corners &= ~CornersRight; + } + if(gtk_widget_get_visible(gtk_scrolled_window_get_hscrollbar(GTK_SCROLLED_WINDOW(widget)))) + corners &= ~CornersBottom; + + int x(allocation.x),y(allocation.y),w(allocation.width),h(allocation.height); + cairo_rectangle(context,x,y,w,h); + if(!Gtk::gdk_default_screen_is_composited()) + { + // Take ugly shadow into account + x+=1; + y+=1; + w-=2; + h-=2; + } + cairo_rounded_rectangle_negative(context,x,y,w,h,2,corners); + cairo_clip(context); + + Style::instance().renderMenuBackground( context, allocation.x,allocation.y,allocation.width,allocation.height, options ); + + // Event handling finished, now let the event propagate + return FALSE; + } + // draw the shadow /* TODO: here child widget's allocation is used instead of window geometry. @@ -312,6 +357,8 @@ allocation.x-offsetX, allocation.y-offsetY, allocation.width+offsetX*2, allocation.height+offsetY*2, options, data ); + #endif // enable inner shadows hack + // let the event propagate return FALSE; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.0.5/src/animations/oxygenwidgetstatedata.cpp new/oxygen-gtk3-1.1.0/src/animations/oxygenwidgetstatedata.cpp --- old/oxygen-gtk3-1.0.5/src/animations/oxygenwidgetstatedata.cpp 2012-06-15 08:46:03.000000000 +0200 +++ new/oxygen-gtk3-1.1.0/src/animations/oxygenwidgetstatedata.cpp 2012-07-16 19:17:32.000000000 +0200 @@ -95,7 +95,7 @@ << std::endl; #endif - if( data._target ) + if( data._target && gtk_widget_get_realized(data._target) ) { Gtk::gtk_widget_queue_draw( data._target, &data._dirtyRect ); } return FALSE; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.0.5/src/oxygencairoutils.cpp new/oxygen-gtk3-1.1.0/src/oxygencairoutils.cpp --- old/oxygen-gtk3-1.0.5/src/oxygencairoutils.cpp 2012-06-15 08:46:03.000000000 +0200 +++ new/oxygen-gtk3-1.1.0/src/oxygencairoutils.cpp 2012-07-16 19:17:32.000000000 +0200 @@ -81,6 +81,23 @@ //__________________________________________________________________ void cairo_rounded_rectangle( cairo_t* context, double x, double y, double w, double h, double r, Corners corners ) { + if(corners==CornersAll) + { + if(w<2*r) + { + double r0=r; + r=0.5*w; + y+=r0-r; + h-=2*(r0-r); + } + if(h<2*r) + { + double r0=r; + r=0.5*h; + x+=r0-r; + w-=2*(r0-r); + } + } if( corners == CornersNone ) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.0.5/src/oxygengtkutils.cpp new/oxygen-gtk3-1.1.0/src/oxygengtkutils.cpp --- old/oxygen-gtk3-1.0.5/src/oxygengtkutils.cpp 2012-06-15 08:46:03.000000000 +0200 +++ new/oxygen-gtk3-1.1.0/src/oxygengtkutils.cpp 2012-07-16 19:17:32.000000000 +0200 @@ -878,10 +878,21 @@ GdkWindow* topLevel = gdk_window_get_toplevel( window ); if( topLevel && GDK_IS_WINDOW( topLevel ) ) { - GdkRectangle rect = {0, 0, -1, -1}; - gdk_window_get_frame_extents( topLevel, &rect ); - if( w ) *w = rect.width; - if( h ) *h = rect.height; + if( gdk_window_get_window_type( topLevel ) == GDK_WINDOW_OFFSCREEN ) + { + + if( w ) *w = gdk_window_get_width(topLevel); + if( h ) *h = gdk_window_get_height(topLevel); + + } else { + + GdkRectangle rect = {0, 0, -1, -1}; + gdk_window_get_frame_extents( topLevel, &rect ); + + if( w ) *w = rect.width; + if( h ) *h = rect.height; + + } } return; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.0.5/src/oxygenqtsettings.cpp new/oxygen-gtk3-1.1.0/src/oxygenqtsettings.cpp --- old/oxygen-gtk3-1.0.5/src/oxygenqtsettings.cpp 2012-06-15 08:46:03.000000000 +0200 +++ new/oxygen-gtk3-1.1.0/src/oxygenqtsettings.cpp 2012-07-16 19:17:32.000000000 +0200 @@ -65,6 +65,7 @@ _viewDrawTreeBranchLines( true ), _viewDrawTriangularExpander( true ), _viewTriangularExpanderSize( ArrowSmall ), + _viewInvertSortIndicator( false ), _menuHighlightMode( MM_DARK ), _windowDragEnabled( true ), _windowDragMode( WD_FULL ), @@ -921,6 +922,9 @@ 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; @@ -1077,7 +1081,7 @@ // button padding _css.setCurrentSection( "GtkButton" ); - _css.addToCurrentSection( Gtk::CSSOption<std::string>( GTK_STYLE_PROPERTY_PADDING, "3px 2px 2px" ) ); + _css.addToCurrentSection( Gtk::CSSOption<std::string>( GTK_STYLE_PROPERTY_PADDING, "3px 4px 2px" ) ); // pathbar button margins _css.addSection( "GtkPathBar>GtkToggleButton" ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.0.5/src/oxygenqtsettings.h new/oxygen-gtk3-1.1.0/src/oxygenqtsettings.h --- old/oxygen-gtk3-1.0.5/src/oxygenqtsettings.h 2012-06-15 08:46:03.000000000 +0200 +++ new/oxygen-gtk3-1.1.0/src/oxygenqtsettings.h 2012-07-16 19:17:32.000000000 +0200 @@ -162,6 +162,10 @@ 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 @@ //! triangular expander size ArrowSize _viewTriangularExpanderSize; + //! true if views sort order indicator arrow direction must be inverted + bool _viewInvertSortIndicator; + //! menu highlight mode MenuHighlightMode _menuHighlightMode; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.0.5/src/oxygenrgba.cpp new/oxygen-gtk3-1.1.0/src/oxygenrgba.cpp --- old/oxygen-gtk3-1.0.5/src/oxygenrgba.cpp 2012-06-15 08:46:03.000000000 +0200 +++ new/oxygen-gtk3-1.1.0/src/oxygenrgba.cpp 2012-07-16 19:17:32.000000000 +0200 @@ -70,29 +70,49 @@ Rgba out; - // split strings using "," as a separator - size_t position = 0; - std::vector<std::string> values; - while( ( position = value.find( ',' ) ) != std::string::npos ) + // parse using regular expression + // two formats are supported: html style (#rrggbb), and KDE style (r,g,b). + GRegex* regex = g_regex_new( + "(?:#((?:\\d|[a-f])+))|" + "(?:(\\d+),(\\d+),(\\d+)(?:,(\\d+))?)", + G_REGEX_CASELESS, (GRegexMatchFlags)0, 0L ); + + GMatchInfo* matchInfo; + g_regex_match( regex, value.c_str(), (GRegexMatchFlags)0, &matchInfo); + const int matchCount( g_match_info_get_match_count( matchInfo ) ); + if( matchCount == 2 ) { - values.push_back( value.substr( 0, position ) ); - value = value.substr( position+1 ); - } - if( !value.empty() ) values.push_back( value ); - for( unsigned int index = 0; index < 4 && index < values.size(); index++ ) - { + // convert to hex number + std::istringstream in( g_match_info_fetch( matchInfo, 1 ) ); + int colorValue = 0; + in >> std::hex >> colorValue; + + out.setBlue( double(colorValue&0xff)/255 ); + out.setGreen( double( (colorValue>>=8)&0xff)/255 ); + out.setRed( double( (colorValue>>=8)&0xff)/255 ); + + } else if( matchCount >= 5 ) { + + for( int index = 0; index < matchCount-2; ++index ) + { + + std::istringstream in( g_match_info_fetch( matchInfo, index+2 ) ); + int colorValue; + if( !(in >> colorValue) ) break; + + if( index == 0 ) out.setRed( double(colorValue)/255 ); + else if( index == 1 ) out.setGreen( double(colorValue)/255 ); + else if( index == 2 ) out.setBlue( double(colorValue)/255 ); + else if( index == 3 ) out.setAlpha( double(colorValue)/255 ); + + } - int colorIndex; - std::istringstream in( values[index] ); - if( !(in >> colorIndex) ) break; - - if( index == 0 ) out.setRed( double(colorIndex)/255 ); - else if( index == 1 ) out.setGreen( double(colorIndex)/255 ); - else if( index == 2 ) out.setBlue( double(colorIndex)/255 ); - else if( index == 3 ) out.setAlpha( double(colorIndex)/255 ); } + // cleanup + g_match_info_free (matchInfo); + g_regex_unref( regex ); return out; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.0.5/src/oxygenshadowconfiguration.cpp new/oxygen-gtk3-1.1.0/src/oxygenshadowconfiguration.cpp --- old/oxygen-gtk3-1.0.5/src/oxygenshadowconfiguration.cpp 2012-06-15 08:46:03.000000000 +0200 +++ new/oxygen-gtk3-1.1.0/src/oxygenshadowconfiguration.cpp 2012-07-16 19:17:32.000000000 +0200 @@ -94,6 +94,9 @@ } + if(!_useOuterColor) + _outerColor=_innerColor; + } //_________________________________________________________ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.0.5/src/oxygenstyle.cpp new/oxygen-gtk3-1.1.0/src/oxygenstyle.cpp --- old/oxygen-gtk3-1.0.5/src/oxygenstyle.cpp 2012-06-15 08:46:03.000000000 +0200 +++ new/oxygen-gtk3-1.1.0/src/oxygenstyle.cpp 2012-07-16 19:17:32.000000000 +0200 @@ -237,7 +237,8 @@ bool Style::renderWindowBackground( cairo_t* context, GdkWindow* window, GtkWidget* widget, gint x, gint y, gint w, gint h, - const StyleOptions& options, TileSet::Tiles tiles ) + const StyleOptions& options, TileSet::Tiles tiles, + bool isMaximized ) { @@ -247,6 +248,8 @@ // define colors ColorUtils::Rgba base( color( Palette::Window, options ) ); + bool renderingWindeco(context && !window); + // the hard-coded metrics are copied for // kdebase/workspace/libs/oxygen/oxygenhelper.cpp // vertical shift to account for window decoration @@ -259,13 +262,13 @@ // TODO: make sure this new test (on window) does not break Ruslan's decorations if( window || widget ) { - // get window dimension and position if( !Gtk::gdk_map_to_toplevel( window, widget, &wx, &wy, &ww, &wh, true ) ) { #if OXYGEN_DEBUG std::cerr << "Oxygen::Style::renderWindowBackground - map_to_toplevel failed" << std::endl; + std::cerr << "original xywh: ("<<x<<","<<y<<","<<w<<","<<h<<")\n"; #endif // flat painting for all other apps @@ -274,9 +277,7 @@ cairo_fill(context); cairo_restore( context ); return false; - } - // translate to toplevel coordinates wy += yShift; x+=wx; @@ -367,13 +368,23 @@ if( hasBackgroundSurface() ) { + // Additional clip constraint so that no extra space is filled (important for LibreOffice) + cairo_rectangle(context,x,y,w,h); + cairo_clip(context); - // no sense in context saving since it will be destroyed + if(renderingWindeco) + { + // Take border sizes into account + int bgShiftX=isMaximized?0:WinDeco::getMetric(WinDeco::BorderLeft); + int bgShiftY=WinDeco::getMetric(WinDeco::BorderTop)-yShift; + cairo_translate(context,bgShiftX,bgShiftY); + } + + // no sense in context saving since it will be either destroyed or restored to earlier state cairo_translate( context, -40, -(48-20) ); cairo_set_source_surface( context, _backgroundSurface, 0, 0 ); cairo_rectangle( context, 0, 0, ww + wx + 40, wh + wy + 48 - 20 ); cairo_fill( context ); - } // restore context @@ -658,26 +669,26 @@ { // first vertical line cairo_move_to( context, xCenter + 0.5 , y ); - cairo_line_to( context, xCenter + 0.5, yCenter - int(cellFlags._expanderSize/3 ) ); + cairo_line_to( context, xCenter + 0.5, yCenter - int(cellFlags._expanderSize/3 )-1 ); // second vertical line if( !isLastCell ) { cairo_move_to( context, xCenter + 0.5, y+h ); - cairo_line_to( context, xCenter + 0.5, yCenter + int( cellFlags._expanderSize/3 ) ); + cairo_line_to( context, xCenter + 0.5, yCenter + int( cellFlags._expanderSize/3 )+2 ); } // horizontal line if( reversed ) { - cairo_move_to( context, xCenter + 1 - int( cellFlags._expanderSize/3 ), yCenter + 0.5 ); + cairo_move_to( context, xCenter - 1 - int( cellFlags._expanderSize/3 ), yCenter + 0.5 ); cairo_line_to( context, xCenter + 1 - cellFlags._expanderSize*2/3, yCenter + 0.5 ); } else { - cairo_move_to( context, xCenter + int( cellFlags._expanderSize/3 ), yCenter + 0.5 ); + cairo_move_to( context, xCenter + 2 + int( cellFlags._expanderSize/3 ), yCenter + 0.5 ); cairo_line_to( context, xCenter + cellFlags._expanderSize*2/3, yCenter + 0.5 ); } @@ -896,7 +907,7 @@ // make sure that width is large enough const int indicatorSize( (options&Vertical ? h:w ) ); - if( indicatorSize >= 4 && w > 0 && h > -1 ) + if( indicatorSize >= 3 && w > 0 && h > 1 ) { // get surface const Cairo::Surface& surface( helper().progressBarIndicator( base, glow, w, h+1 ) ); @@ -1313,7 +1324,7 @@ } cairo_set_source( context, pattern ); - helper().fillSlab( context, x, y, w, h, tiles ); + helper().fillSlab( context, x, y, w, h+1, tiles ); cairo_restore( context ); if( options&Sunken ) @@ -1370,28 +1381,19 @@ const ColorUtils::Rgba& glow ) { - // define colors - gint wh, wy; - Gtk::gdk_map_to_toplevel( 0L, widget, 0L, &wy, 0L, &wh ); - const ColorUtils::Rgba base( ColorUtils::backgroundColor( settings().palette().color( Palette::Button ), wh, y+wy+h/2 ) ); - - // save context + // save context cairo_save( context ); - // fill - { - Cairo::Pattern pattern; - const ColorUtils::Rgba shadow( ColorUtils::shadowColor( base ) ); - pattern.set( cairo_pattern_create_linear( 0, y-h, 0, y+h ) ); - cairo_pattern_add_color_stop( pattern, 0, ColorUtils::lightColor( base ) ); - cairo_pattern_add_color_stop( pattern, 1.0, base ); - - cairo_set_source( context, pattern ); - helper().fillSlab( context, x, y, w, h ); - } + // content + cairo_rounded_rectangle( context, x+1, y+1, w-2, h-2, 5 ); + cairo_set_source( context, glow ); + cairo_fill( context ); - // slab - helper().slab( base, glow, 0 ).render( context, x, y, w, h ); + // border + cairo_set_line_width( context, 1.0 ); + cairo_rounded_rectangle( context, 1.5+x, 1.5+y, w-3, h-3, 4.5 ); + cairo_set_source( context, ColorUtils::darken( glow ) ); + cairo_stroke( context ); // restore cairo_restore( context ); @@ -1468,7 +1470,9 @@ ColorUtils::Rgba base( ColorUtils::decoColor( background, color ) ); ColorUtils::Rgba contrast( ColorUtils::lightColor( background ) ); - if( options&Active ) + // We don't want to change color on active state for menu checkboxes (it's never passed by GTK) + // Also, if we ignore active state, we get correct render for LibreOffice + if( options&Active && !(options&Flat) ) { base = ColorUtils::alphaColor( base, 0.3 ); contrast = ColorUtils::alphaColor( contrast, 0.3 ); @@ -1629,7 +1633,9 @@ ColorUtils::Rgba base( ColorUtils::decoColor( background, color ) ); ColorUtils::Rgba contrast( ColorUtils::lightColor( background ) ); - if( options&Active ) + // We don't want to change color on active state for menu radiobuttons (it's never passed by GTK) + // Also, if we ignore active state, we get correct render for LibreOffice + if( options&Active && !(options&Menu ) ) { base = ColorUtils::alphaColor( base, 0.3 ); contrast = ColorUtils::alphaColor( contrast, 0.3 ); @@ -2356,8 +2362,9 @@ cairo_rounded_rectangle(context,x,y,w,h,3.5); cairo_clip(context); } + if( gradient ) - renderWindowBackground( context, 0L, 0L, x, y, w, h ); + renderWindowBackground( context, x, y, w, h, isMaximized ); else { cairo_set_source( context, settings().palette().color( Palette::Active, Palette::Window ) ); @@ -2372,7 +2379,7 @@ if(wopt & WinDeco::Active) options|=Focus; if( !isMaximized ) - { drawFloatFrame( context, x, y, w, h, options, Palette::InactiveWindowBackground ); } + { drawFloatFrame( context, x, y, w, h, options ); } if( drawResizeHandle ) { @@ -2564,7 +2571,7 @@ pango_font_description_set_family( fdesc, font.family().c_str() ); pango_font_description_set_weight( fdesc, PangoWeight( (font.weight()+2)*10 ) ); pango_font_description_set_style( fdesc, font.italic() ? PANGO_STYLE_ITALIC : PANGO_STYLE_NORMAL ); - pango_font_description_set_size( fdesc, int(font.size()*PANGO_SCALE) ); + pango_font_description_set_absolute_size( fdesc, int(font.size()*PANGO_SCALE) ); PangoLayout* layout( pango_cairo_create_layout(context) ); pango_layout_set_text( layout,caption, -1 ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.0.5/src/oxygenstyle.h new/oxygen-gtk3-1.1.0/src/oxygenstyle.h --- old/oxygen-gtk3-1.0.5/src/oxygenstyle.h 2012-06-15 08:46:03.000000000 +0200 +++ new/oxygen-gtk3-1.1.0/src/oxygenstyle.h 2012-07-16 19:17:32.000000000 +0200 @@ -135,7 +135,12 @@ //! window background /*! returns true if window gradient could be rendered */ - bool renderWindowBackground( cairo_t*, GdkWindow*, GtkWidget*, gint, gint, gint, gint, const StyleOptions& = StyleOptions(), TileSet::Tiles = TileSet::Center ); + bool renderWindowBackground( cairo_t*, GdkWindow*, GtkWidget*, gint, gint, gint, gint, const StyleOptions& = StyleOptions(), TileSet::Tiles = TileSet::Center, bool isMaximized=false ); + bool renderWindowBackground( cairo_t* c, gint x, gint y, gint w, gint h, bool maximized ) + { return renderWindowBackground( c, 0, 0, x, y, w, h, StyleOptions(), TileSet::Center, maximized );} + + bool renderWindowBackground( GdkWindow* window, GtkWidget* widget, gint x, gint y, gint w, gint h, const StyleOptions& o = StyleOptions(), TileSet::Tiles tiles= TileSet::Center ) + { return renderWindowBackground( 0L, window, widget, x, y, w, h, o, tiles ); } bool renderWindowBackground( cairo_t* context, GdkWindow* window, gint x, gint y, gint w, gint h, const StyleOptions& o = StyleOptions(), TileSet::Tiles tiles= TileSet::Center) { return renderWindowBackground( context, window, 0L, x, y, w, h, o, tiles ); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.0.5/src/oxygenstylehelper.cpp new/oxygen-gtk3-1.1.0/src/oxygenstylehelper.cpp --- old/oxygen-gtk3-1.0.5/src/oxygenstylehelper.cpp 2012-06-15 08:46:03.000000000 +0200 +++ new/oxygen-gtk3-1.1.0/src/oxygenstylehelper.cpp 2012-07-16 19:17:32.000000000 +0200 @@ -230,7 +230,7 @@ // create cairo context Cairo::Context context( surface ); - const double u = double(size)/18.0; + const double u = size/18.0; cairo_translate( context, 0.5*u, (0.5-0.668)*u ); { @@ -289,7 +289,7 @@ const ColorUtils::Rgba& dark( base ); Cairo::Context context( surface ); - const double u = double(size)/18.0; + const double u = size/18.0; cairo_translate( context, 0.5*u, (0.5-0.668)*u ); { @@ -409,7 +409,7 @@ { // create cairo context Cairo::Context context( surface ); - cairo_scale( context, double(size)/7, double(size)/7 ); + cairo_scale( context, size/7.0, size/7.0 ); cairo_rectangle( context, 0, 0, 14, 14 ); cairo_set_source( context, ColorUtils::Rgba::transparent( base ) ); cairo_fill( context ); @@ -443,7 +443,7 @@ // create cairo context Cairo::Context context( surface ); cairo_set_line_width( context, 1.0 ); - cairo_scale( context, double(size)/7, double(size)/7 ); + cairo_scale( context, size/7.0, size/7.0 ); cairo_rectangle( context, 0, 0, 14, 14 ); cairo_set_source( context, ColorUtils::Rgba::transparent( base ) ); cairo_fill( context ); @@ -489,7 +489,7 @@ // create cairo context Cairo::Context context( surface ); - cairo_scale( context, double(size)/7, double(size)/7 ); + cairo_scale( context, size/7.0, size/7.0 ); // shadow if( base.isValid() ) drawShadow( context, ColorUtils::shadowColor(base), 21 ); @@ -522,14 +522,14 @@ Cairo::Context context( surface ); cairo_save( context ); - cairo_scale( context, double( 3*size )/23, double( 3*size )/23 ); + cairo_scale( context, 3.0*size/23, 3.0*size/23 ); cairo_translate( context, 1, 1 ); if( base.isValid() ) drawShadow( context, ColorUtils::alphaColor( ColorUtils::shadowColor(base), 0.8 ), 21 ); if( glow.isValid() ) drawOuterGlow( context, glow, 21 ); cairo_restore( context ); - cairo_scale( context, double( 3*size )/25, double( 3*size )/25 ); + cairo_scale( context, 3.0*size/25, 3.0*size/25 ); cairo_translate( context, 2, 2 ); drawSliderSlab( context, base, sunken, shade ); @@ -583,7 +583,7 @@ } - cairo_rounded_rectangle( context, double(x)+s, double(y)+s, double(w)-2*s, double(h)-2*s, r, corners ); + cairo_rounded_rectangle( context, x+s, y+s, w-2*s, h-2*s, r, corners ); cairo_fill( context ); } @@ -1056,7 +1056,7 @@ { // shadow - cairo_rounded_rectangle( context, double(xl)+0.5, double(yl)+0.5, wl-1, hl, 3.0 ); + cairo_rounded_rectangle( context, xl+0.5, yl+0.5, wl-1, hl, 3.0 ); cairo_set_source( context, ColorUtils::alphaColor( shadow, 0.6 ) ); cairo_set_line_width( context, 0.6 ); cairo_stroke( context ); @@ -1114,21 +1114,21 @@ cairo_pattern_add_color_stop( pattern, 1.0, ColorUtils::darkColor(highlight) ); cairo_set_line_width( context, 1.0 ); cairo_set_source( context, pattern ); - cairo_rounded_rectangle( context, double(xl)+0.5, double(yl)+0.5, wl-1, hl-1, 2.5 ); + cairo_rounded_rectangle( context, xl+0.5, yl+0.5, wl-1, hl-1, 2.5 ); cairo_stroke( context ); } { // bright top edge - Cairo::Pattern pattern( cairo_pattern_create_linear( 0, 0, wl, 0 ) ); + Cairo::Pattern pattern( cairo_pattern_create_linear( xl, 0, xl+wl, 0 ) ); const ColorUtils::Rgba mix( ColorUtils::mix( lhighlight, light, 0.8 ) ); cairo_pattern_add_color_stop( pattern, 0.0, ColorUtils::Rgba::transparent( mix ) ); cairo_pattern_add_color_stop( pattern, 0.5, mix ); cairo_pattern_add_color_stop( pattern, 1.0, ColorUtils::Rgba::transparent( mix ) ); cairo_set_line_width( context, 1.0 ); cairo_set_source( context, pattern ); - cairo_move_to( context, double(xl)+0.5, double(yl)+0.5 ); - cairo_line_to( context, double(xl+wl)-0.5, double(yl)+0.5 ); + cairo_move_to( context, xl+0.5, yl+0.5 ); + cairo_line_to( context, xl+wl-0.5, yl+0.5 ); cairo_stroke( context ); } @@ -1146,7 +1146,7 @@ const TileSet& tileSet( _grooveCache.value( key ) ); if( tileSet.isValid() ) return tileSet; - const int rsize( ( int )ceil( double( size ) * 3.0/7.0 ) ); + const int rsize( int( ceil( size * 3.0/7.0 ) ) ); const int w( rsize*2 ); const int h( rsize*2 ); Cairo::Surface surface( createSurface( w, h ) ); @@ -1208,7 +1208,7 @@ cairo_pattern_add_color_stop( pattern, 0, base ); cairo_pattern_add_color_stop( pattern, 1, ColorUtils::Rgba::transparent() ); - cairo_rounded_rectangle( context, double(x)+0.5, double(y)+0.5, w-1, h-1, rounding ); + cairo_rounded_rectangle( context, x+0.5, y+0.5, w-1, h-1, rounding ); cairo_set_source( context, pattern ); cairo_stroke( context ); } @@ -1227,11 +1227,11 @@ const ColorUtils::Rgba light( ColorUtils::lightColor( base ) ); const ColorUtils::Rgba dark( ColorUtils::darkColor( base ).dark(130) ); - cairo_ellipse( context, double(x) + 1.0 - diameter/2, double(y) + 1.0 - diameter/2.0, diameter, diameter ); + cairo_ellipse( context, x + 1.0 - diameter/2, y + 1.0 - diameter/2.0, diameter, diameter ); cairo_set_source( context, light ); cairo_fill( context ); - cairo_ellipse( context, double(x) + 0.5 - diameter/2, double(y) + 0.5 - diameter/2.0, diameter, diameter ); + cairo_ellipse( context, x + 0.5 - diameter/2, y + 0.5 - diameter/2.0, diameter, diameter ); cairo_set_source( context, dark ); cairo_fill( context ); } @@ -1299,10 +1299,10 @@ } //___________________________________________________________________________________________ - void StyleHelper::drawShadow( Cairo::Context& context, const ColorUtils::Rgba& base, int size ) const + void StyleHelper::drawShadow( cairo_t* context, const ColorUtils::Rgba& base, int size ) const { - const double m( double(size-2)*0.5 ); + const double m( 0.5*size-1 ); const double offset( 0.8 ); const double k0( (m-4.0) / m ); @@ -1313,7 +1313,7 @@ for (int i = 0; i < 8; i++) { // sinusoidal pattern - const double k1( (k0 * double(8 - i) + double(i)) * 0.125 ); + const double k1( (k0 * (8 - i) + i) * 0.125 ); const double a( (cos( M_PI * i * 0.125) + 1.0) * 0.30 ); cairo_pattern_add_color_stop( pattern, k1, ColorUtils::alphaColor( base, a*_shadowGain ) ); } @@ -1326,13 +1326,13 @@ } //_______________________________________________________________________ - void StyleHelper::drawOuterGlow( Cairo::Context& context, const ColorUtils::Rgba& base, int size ) const + void StyleHelper::drawOuterGlow( cairo_t* context, const ColorUtils::Rgba& base, int size ) const { - const double m( double(size)*0.5 ); + const double m( size*0.5 ); const double w( 3 ); - const double bias( _glowBias * double(14)/size ); + const double bias( _glowBias * 14.0/size ); // k0 is located at w - bias from the outer edge const double gm( m + bias - 0.9 ); @@ -1342,8 +1342,8 @@ for (int i = 0; i < 8; i++) { // parabolic pattern - const double k1( k0 + double(i)*(1.0-k0)/8.0 ); - const double a( 1.0 - sqrt(double(i)/8) ); + const double k1( k0 + i*(1.0-k0)/8.0 ); + const double a( 1.0 - sqrt(i/8.0) ); cairo_pattern_add_color_stop( pattern, k1, ColorUtils::alphaColor( base, a ) ); } @@ -1382,7 +1382,7 @@ int pad, int size, int rsize ) const { - const double m( double( size )*0.5 ); + const double m( size*0.5 ); const double width( 3.5 ); const double bias( _glowBias*7.0/rsize ); @@ -1391,7 +1391,7 @@ for ( int i = 0; i < 8; i++ ) { // inverse parabolic gradient - double k1 = ( k0 * double( i ) + double( 8 - i ) ) * 0.125; + double k1 = ( k0 * i + 8 - i ) * 0.125; double a = 1.0 - sqrt( i * 0.125 ); cairo_pattern_add_color_stop( pattern, k1, ColorUtils::alphaColor( base, a ) ); @@ -1504,9 +1504,9 @@ int pad, int size, double fuzz ) const { - const double m( double(size)*0.5 ); + const double m( size*0.5 ); const double offset( 0.8 ); - const double k0( (m-2) / double(m+2.0) ); + const double k0( (m-2) / (m+2.0) ); const double x(pad+m); const double y(pad+m+offset); @@ -1515,7 +1515,7 @@ for (int i = 0; i < 8; i++) { // sinusoidal pattern - const double k1( (double(8 - i) + k0 * double(i)) * 0.125 ); + const double k1( (8 - i + k0 * i) * 0.125 ); const double a( (cos(3.14159 * i * 0.125) + 1.0) * 0.25 ); cairo_pattern_add_color_stop( pattern, k1, ColorUtils::alphaColor( base, a*_shadowGain ) ); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.0.5/src/oxygenstylehelper.h new/oxygen-gtk3-1.1.0/src/oxygenstylehelper.h --- old/oxygen-gtk3-1.0.5/src/oxygenstylehelper.h 2012-06-15 08:46:03.000000000 +0200 +++ new/oxygen-gtk3-1.1.0/src/oxygenstylehelper.h 2012-07-16 19:17:32.000000000 +0200 @@ -192,6 +192,12 @@ CairoSurfaceCache<WindecoBottomBorderKey>& windecoBottomBorderCache( void ) { return _windecoBottomBorderCache; } + //! shadow rendering + virtual void drawShadow( cairo_t*, const ColorUtils::Rgba&, int size ) const; + + //! highlight glow + virtual void drawOuterGlow( cairo_t*, const ColorUtils::Rgba&, int size) const; + //@} //@} @@ -208,12 +214,6 @@ //! slab rendering virtual void drawSlab( Cairo::Context&, const ColorUtils::Rgba&, double shade) const; - //! shadow rendering - virtual void drawShadow( Cairo::Context&, const ColorUtils::Rgba&, int size ) const; - - //! highlight glow - virtual void drawOuterGlow( Cairo::Context&, const ColorUtils::Rgba&, int size) const; - //! inverse shadow (for sunken slabs) void drawInverseShadow( Cairo::Context&, const ColorUtils::Rgba&, int pad, int size, double fuzz ) const; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.0.5/src/oxygenthemingengine.cpp new/oxygen-gtk3-1.1.0/src/oxygenthemingengine.cpp --- old/oxygen-gtk3-1.0.5/src/oxygenthemingengine.cpp 2012-06-15 08:46:03.000000000 +0200 +++ new/oxygen-gtk3-1.1.0/src/oxygenthemingengine.cpp 2012-07-16 19:17:32.000000000 +0200 @@ -308,7 +308,14 @@ } else { - Style::instance().renderWindowBackground( context, window, x, y, w, h ); + // get background color + GdkRGBA background_gtk; + gtk_theming_engine_get_background_color( engine, state, &background_gtk ); + StyleOptions options; + options._customColors.insert( Palette::Window, Gtk::gdk_get_color( background_gtk ) ); + + // render background + Style::instance().renderWindowBackground( context, window, x, y, w, h, options ); } @@ -335,7 +342,7 @@ // draw flat selection in combobox list if( state & GTK_STATE_FLAG_SELECTED) { - ColorUtils::Rgba selection( Style::instance().settings().palette().color( Palette::Active, Palette::Selected ) ); + const ColorUtils::Rgba selection( Style::instance().settings().palette().color( Palette::Active, Palette::Selected ) ); Style::instance().fill( context, x, y, w, h, selection ); } @@ -496,6 +503,7 @@ gtk_theming_engine_has_class( engine, GTK_STYLE_CLASS_SCALE ) || gtk_theming_engine_has_class( engine, GTK_STYLE_CLASS_INFO ) || gtk_theming_engine_has_class( engine, GTK_STYLE_CLASS_TROUGH ) || + gtk_widget_path_is_type( path, GTK_TYPE_LABEL ) || gtk_widget_path_is_type( path, GTK_TYPE_INFO_BAR ) || gtk_widget_path_is_type( path, GTK_TYPE_BUTTON ) || gtk_widget_path_is_type( path, GTK_TYPE_MENU_ITEM ) || @@ -562,8 +570,9 @@ // always register to widget size engine Style::instance().animations().widgetSizeEngine().registerWidget( parent ); const bool sizeChanged( Style::instance().animations().widgetSizeEngine().updateSize( parent, allocation.width, allocation.height ) ); + const bool wasAlpha(Style::instance().animations().widgetSizeEngine().wasAlpha(parent)); - if( sizeChanged ) + if( sizeChanged || (!(options&Alpha) && wasAlpha) || (!wasAlpha && (options&Alpha)) ) { if( !(options&Alpha) ) { @@ -571,8 +580,17 @@ // make background window rounded Cairo::Region mask( Style::instance().helper().roundMask( allocation.width, allocation.height ) ); gdk_window_shape_combine_region( gtk_widget_get_window( parent ), mask, 0, 0 ); + + Style::instance().animations().widgetSizeEngine().setAlpha(parent, false); } + else if( !wasAlpha ) + { + // reset XShape mask on transition from non-composited to composited + gdk_window_shape_combine_region( gtk_widget_get_window( parent ), NULL, 0, 0 ); + Style::instance().animations().widgetSizeEngine().setAlpha(parent, true); + } +#if !ENABLE_INNER_SHADOWS_HACK // also sets inner list mask if( GtkWidget* child = gtk_bin_get_child( GTK_BIN( widget ) ) ) { @@ -589,7 +607,7 @@ gdk_window_shape_combine_region( gtk_widget_get_window( child ), mask, offset, offset ); } - +#endif } // menu background and float frame @@ -754,29 +772,7 @@ return; - } - - // treeview headers - if( Gtk::gtk_button_is_header( widget ) - || gtk_theming_engine_has_class( engine, GTK_STYLE_CLASS_HEADER ) - || gtk_theming_engine_has_region( engine, GTK_STYLE_REGION_COLUMN_HEADER, 0L ) ) - { - - // register to scrolled window engine if any - if( - ( parent = Gtk::gtk_parent_scrolled_window( widget ) ) && - Style::instance().animations().scrolledWindowEngine().contains( parent ) - ) - { Style::instance().animations().scrolledWindowEngine().registerChild( parent, widget ); } - - // treevew header - Style::instance().renderHeaderBackground( context, 0L, widget, x, y, w, h ); - return; - - } - - // combobox entry buttons - if( ( parent = Gtk::gtk_parent_combobox_entry( widget ) ) ) { + } else if( ( parent = Gtk::gtk_parent_combobox_entry( widget ) ) ) { // combobox entry buttons // keep track of whether button is active (pressed-down) or pre-lighted @@ -845,11 +841,7 @@ return; - } - - // combobox buttons - if( ( parent = Gtk::gtk_parent_combobox( widget ) ) && Gtk::gtk_combobox_appears_as_list( parent ) ) - { + } else if( ( parent = Gtk::gtk_parent_combobox( widget ) ) && Gtk::gtk_combobox_appears_as_list( parent ) ) { // combobox buttons const bool reversed( Gtk::gtk_theming_engine_layout_is_reversed( engine ) ); @@ -897,12 +889,25 @@ } - } + } else if( Gtk::gtk_button_is_header( widget ) + || gtk_theming_engine_has_class( engine, GTK_STYLE_CLASS_HEADER ) + || gtk_theming_engine_has_region( engine, GTK_STYLE_REGION_COLUMN_HEADER, 0L ) ) { - // notebook close buttons - if( Gtk::gtk_notebook_is_close_button(widget)) - { + // treeview headers + // register to scrolled window engine if any + if( + ( parent = Gtk::gtk_parent_scrolled_window( widget ) ) && + Style::instance().animations().scrolledWindowEngine().contains( parent ) + ) + { Style::instance().animations().scrolledWindowEngine().registerChild( parent, widget ); } + // treevew header + Style::instance().renderHeaderBackground( context, 0L, widget, x, y, w, h ); + return; + + } else if( Gtk::gtk_notebook_is_close_button(widget)) { + + // notebook close buttons if( gtk_button_get_relief(GTK_BUTTON(widget))==GTK_RELIEF_NONE ) { gtk_button_set_relief(GTK_BUTTON(widget),GTK_RELIEF_NORMAL); } @@ -930,10 +935,12 @@ return; - } + } else if( GTK_IS_TOOL_ITEM_GROUP( widget ) ) { - // tool itemgroup buttons - if( GTK_IS_TOOL_ITEM_GROUP( widget ) ) return; + // tool itemgroup buttons + return; + + } StyleOptions options( widget, state ); options |= Blend; @@ -1887,7 +1894,7 @@ // 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 ); @@ -1994,23 +2001,29 @@ 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 ) ) { @@ -2204,6 +2217,20 @@ << std::endl; #endif + // draw progressbar text white if above indicator, black if not + if( gtk_theming_engine_has_class( engine, GTK_STYLE_CLASS_PROGRESSBAR ) ) + { + + cairo_save( context ); + const ColorUtils::Rgba selection( Style::instance().settings().palette().color( Palette::Active, Palette::SelectedText ) ); + cairo_set_source( context, selection ); + cairo_translate(context,x,y); + pango_cairo_show_layout(context,layout); + cairo_restore( context ); + return; + + } + const GtkWidgetPath* path( gtk_theming_engine_get_path(engine) ); if( Gtk::gtk_widget_path_has_type( path, GTK_TYPE_LABEL ) ) { @@ -2406,16 +2433,6 @@ x-=2; w+=4; #endif - } else if( GTK_IS_TREE_VIEW( widget ) ) { - - y-=2; h+=4; - x-=2; w+=4; - - } else if( GTK_IS_CELL_VIEW( widget ) ) { - - y-=1; h+=2; - x-=1; w+=2; - } Style::instance().renderProgressBarHandle( context, x, y, w, h, options ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oxygen-gtk3-1.0.5/src/oxygenwindecobutton.cpp new/oxygen-gtk3-1.1.0/src/oxygenwindecobutton.cpp --- old/oxygen-gtk3-1.0.5/src/oxygenwindecobutton.cpp 2012-06-15 08:46:03.000000000 +0200 +++ new/oxygen-gtk3-1.1.0/src/oxygenwindecobutton.cpp 2012-07-16 19:17:32.000000000 +0200 @@ -43,26 +43,28 @@ cairo_translate( context, x, y ); const ColorUtils::Rgba base( settings().palette().color( _state == Disabled ? Palette::Disabled : Palette::Active, Palette::Window ) ); - ColorUtils::Rgba shadow( settings().palette().color( Palette::WindowText ) ); - ColorUtils::Rgba icon(shadow); + ColorUtils::Rgba glow( settings().palette().color( Palette::WindowText ) ); + ColorUtils::Rgba icon(glow); const double scale( (21.0*settings().buttonSize())/22.0 ); // draw shadow - if(_state==Hovered) + if(_state==Hovered||_state==Pressed) { - shadow=(_type==ButtonClose)? + glow=(_type==ButtonClose)? ColorUtils::Rgba( settings().palette().color( Palette::NegativeText ) ): ColorUtils::Rgba( settings().palette().color( Palette::Hover ) ); - shadow=darkColor(shadow); - icon=shadow; + icon=glow; } else { - shadow=ColorUtils::Rgba(0,0,0); + glow=ColorUtils::Rgba(0,0,0); } - const Cairo::Surface& windecoButtonGlow( helper().windecoButtonGlow( shadow, int(scale) ) ); - cairo_set_source_surface( context, windecoButtonGlow, 0, 0 ); - cairo_rectangle( context, 0, 0, w, h ); - cairo_fill( context ); + cairo_save(context); + cairo_scale(context,int(scale)/21.,int(scale)/21.); + cairo_translate(context,0,-1.4); + _helper.drawShadow(context,ColorUtils::shadowColor(base),21); + if(_state==Hovered||_state==Pressed) + _helper.drawOuterGlow(context,glow,21); + cairo_restore(context); // draw button slab const bool pressed( _state == Pressed || _type==ButtonUnstick || _type==ButtonUndoAbove || _type==ButtonUndoBelow ); -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de