Kaydet (Commit) 9bc6cb2b authored tarafından Caolán McNamara's avatar Caolán McNamara

gtk3: nwf for progress bars

Change-Id: If45020ba9916f9df9b602f57c443f828c8d1de1a
üst ae451af8
...@@ -89,6 +89,7 @@ private: ...@@ -89,6 +89,7 @@ private:
static GtkStyleContext *mpFixedHoriLineStyle; static GtkStyleContext *mpFixedHoriLineStyle;
static GtkStyleContext *mpFixedVertLineStyle; static GtkStyleContext *mpFixedVertLineStyle;
static GtkStyleContext *mpTreeHeaderButtonStyle; static GtkStyleContext *mpTreeHeaderButtonStyle;
static GtkStyleContext *mpProgressBarStyle;
static Rectangle NWGetScrollButtonRect( ControlPart nPart, Rectangle aAreaRect ); static Rectangle NWGetScrollButtonRect( ControlPart nPart, Rectangle aAreaRect );
static Rectangle NWGetSpinButtonRect( ControlPart nPart, Rectangle aAreaRect); static Rectangle NWGetSpinButtonRect( ControlPart nPart, Rectangle aAreaRect);
......
...@@ -45,6 +45,7 @@ GtkStyleContext* GtkSalGraphics::mpFrameOutStyle = NULL; ...@@ -45,6 +45,7 @@ GtkStyleContext* GtkSalGraphics::mpFrameOutStyle = NULL;
GtkStyleContext* GtkSalGraphics::mpFixedHoriLineStyle = NULL; GtkStyleContext* GtkSalGraphics::mpFixedHoriLineStyle = NULL;
GtkStyleContext* GtkSalGraphics::mpFixedVertLineStyle = NULL; GtkStyleContext* GtkSalGraphics::mpFixedVertLineStyle = NULL;
GtkStyleContext* GtkSalGraphics::mpTreeHeaderButtonStyle = NULL; GtkStyleContext* GtkSalGraphics::mpTreeHeaderButtonStyle = NULL;
GtkStyleContext* GtkSalGraphics::mpProgressBarStyle = NULL;
bool GtkSalGraphics::style_loaded = false; bool GtkSalGraphics::style_loaded = false;
/************************************************************************ /************************************************************************
...@@ -90,7 +91,8 @@ enum { ...@@ -90,7 +91,8 @@ enum {
RENDER_EXTENSION = 12, RENDER_EXTENSION = 12,
RENDER_EXPANDER = 13, RENDER_EXPANDER = 13,
RENDER_ICON = 14, RENDER_ICON = 14,
RENDER_FOCUS = 15, RENDER_PROGRESS = 15,
RENDER_FOCUS = 16,
}; };
static void NWCalcArrowRect( const Rectangle& rButton, Rectangle& rArrow ) static void NWCalcArrowRect( const Rectangle& rButton, Rectangle& rArrow )
...@@ -1007,6 +1009,11 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co ...@@ -1007,6 +1009,11 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
styleClass = GTK_STYLE_CLASS_ARROW; styleClass = GTK_STYLE_CLASS_ARROW;
} }
break; break;
case CTRL_PROGRESS:
context = mpProgressBarStyle;
renderType = RENDER_PROGRESS;
styleClass = GTK_STYLE_CLASS_TROUGH;
break;
default: default:
return false; return false;
} }
...@@ -1127,6 +1134,29 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co ...@@ -1127,6 +1134,29 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
break; break;
} }
case RENDER_PROGRESS:
{
gtk_render_background(context, cr, nX, nY, nWidth, nHeight);
gtk_render_frame(context, cr, nX, nY, nWidth, nHeight);
long nProgressWidth = rValue.getNumericVal();
if (nProgressWidth)
{
GtkBorder padding;
gtk_style_context_get_padding(context, GTK_STATE_FLAG_NORMAL, &padding);
gtk_style_context_remove_class(context, GTK_STYLE_CLASS_TROUGH);
gtk_style_context_add_class(context, GTK_STYLE_CLASS_PROGRESSBAR);
gtk_style_context_add_class(context, GTK_STYLE_CLASS_PULSE);
nX += padding.left;
nY += padding.top;
nHeight -= (padding.top + padding.bottom);
nProgressWidth -= (padding.left + padding.right);
gtk_render_background(context, cr, nX, nY, nProgressWidth, nHeight);
gtk_render_frame(context, cr, nX, nY, nProgressWidth, nHeight);
}
break;
}
default: default:
break; break;
} }
...@@ -1726,7 +1756,7 @@ bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP ...@@ -1726,7 +1756,7 @@ bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP
case CTRL_PUSHBUTTON: case CTRL_PUSHBUTTON:
case CTRL_RADIOBUTTON: case CTRL_RADIOBUTTON:
case CTRL_CHECKBOX: case CTRL_CHECKBOX:
// case CTRL_PROGRESS: case CTRL_PROGRESS:
// case CTRL_LISTNODE: // case CTRL_LISTNODE:
// case CTRL_LISTNET: // case CTRL_LISTNET:
if (nPart==PART_ENTIRE_CONTROL || nPart == PART_FOCUS) if (nPart==PART_ENTIRE_CONTROL || nPart == PART_FOCUS)
...@@ -2033,6 +2063,9 @@ GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow ) ...@@ -2033,6 +2063,9 @@ GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow )
GtkWidget* pTreeHeaderCellWidget = gtk_tree_view_column_get_button(middleTreeViewColumn); GtkWidget* pTreeHeaderCellWidget = gtk_tree_view_column_get_button(middleTreeViewColumn);
mpTreeHeaderButtonStyle = gtk_widget_get_style_context(pTreeHeaderCellWidget); mpTreeHeaderButtonStyle = gtk_widget_get_style_context(pTreeHeaderCellWidget);
/* Progress Bar */
getStyleContext(&mpProgressBarStyle, gtk_progress_bar_new());
gtk_widget_show_all(gDumbContainer); gtk_widget_show_all(gDumbContainer);
} }
......
Markdown is supported
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