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

gtk3: implement tree header bar area

Change-Id: I9f4ef42eb35524714a170e9f4a4d5ef13e198efd
üst 4b5091cf
...@@ -88,6 +88,7 @@ private: ...@@ -88,6 +88,7 @@ private:
static GtkStyleContext *mpFrameOutStyle; static GtkStyleContext *mpFrameOutStyle;
static GtkStyleContext *mpFixedHoriLineStyle; static GtkStyleContext *mpFixedHoriLineStyle;
static GtkStyleContext *mpFixedVertLineStyle; static GtkStyleContext *mpFixedVertLineStyle;
static GtkStyleContext *mpTreeHeaderButtonStyle;
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);
......
...@@ -44,6 +44,7 @@ GtkStyleContext* GtkSalGraphics::mpFrameInStyle = NULL; ...@@ -44,6 +44,7 @@ GtkStyleContext* GtkSalGraphics::mpFrameInStyle = NULL;
GtkStyleContext* GtkSalGraphics::mpFrameOutStyle = NULL; GtkStyleContext* GtkSalGraphics::mpFrameOutStyle = NULL;
GtkStyleContext* GtkSalGraphics::mpFixedHoriLineStyle = NULL; GtkStyleContext* GtkSalGraphics::mpFixedHoriLineStyle = NULL;
GtkStyleContext* GtkSalGraphics::mpFixedVertLineStyle = NULL; GtkStyleContext* GtkSalGraphics::mpFixedVertLineStyle = NULL;
GtkStyleContext* GtkSalGraphics::mpTreeHeaderButtonStyle = NULL;
bool GtkSalGraphics::style_loaded = false; bool GtkSalGraphics::style_loaded = false;
/************************************************************************ /************************************************************************
...@@ -814,6 +815,7 @@ static GtkWidget* gFrameIn; ...@@ -814,6 +815,7 @@ static GtkWidget* gFrameIn;
static GtkWidget* gFrameOut; static GtkWidget* gFrameOut;
static GtkWidget* gMenuBarWidget; static GtkWidget* gMenuBarWidget;
static GtkWidget* gMenuItemMenuBarWidget; static GtkWidget* gMenuItemMenuBarWidget;
static GtkWidget* gTreeViewWidget;
bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& rValue, ControlState nState, const ImplControlValue& rValue,
...@@ -987,6 +989,10 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co ...@@ -987,6 +989,10 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
case CTRL_FIXEDLINE: case CTRL_FIXEDLINE:
context = nPart == PART_SEPARATOR_HORZ ? mpFixedHoriLineStyle : mpFixedVertLineStyle; context = nPart == PART_SEPARATOR_HORZ ? mpFixedHoriLineStyle : mpFixedVertLineStyle;
renderType = RENDER_SEPERATOR; renderType = RENDER_SEPERATOR;
break;
case CTRL_LISTHEADER:
context = mpTreeHeaderButtonStyle;
break;
default: default:
return false; return false;
} }
...@@ -1789,10 +1795,10 @@ bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP ...@@ -1789,10 +1795,10 @@ bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP
return true; return true;
break; break;
// case CTRL_LISTHEADER: case CTRL_LISTHEADER:
// if(nPart == PART_BUTTON || nPart == PART_ARROW) if (nPart == PART_BUTTON /*|| nPart == PART_ARROW*/)
// return true; return true;
// break; break;
} }
printf( "Unhandled is native supported for Type: %d, Part %d\n", printf( "Unhandled is native supported for Type: %d, Part %d\n",
...@@ -1984,6 +1990,27 @@ GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow ) ...@@ -1984,6 +1990,27 @@ GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow )
getStyleContext(&mpFixedHoriLineStyle, gtk_separator_new(GTK_ORIENTATION_HORIZONTAL)); getStyleContext(&mpFixedHoriLineStyle, gtk_separator_new(GTK_ORIENTATION_HORIZONTAL));
getStyleContext(&mpFixedVertLineStyle, gtk_separator_new(GTK_ORIENTATION_VERTICAL)); getStyleContext(&mpFixedVertLineStyle, gtk_separator_new(GTK_ORIENTATION_VERTICAL));
/* Tree List */
gTreeViewWidget = gtk_tree_view_new();
gtk_container_add(GTK_CONTAINER(gDumbContainer), gTreeViewWidget);
GtkTreeViewColumn* firstTreeViewColumn = gtk_tree_view_column_new();
gtk_tree_view_column_set_title(firstTreeViewColumn, "M");
gtk_tree_view_append_column(GTK_TREE_VIEW(gTreeViewWidget), firstTreeViewColumn);
GtkTreeViewColumn* middleTreeViewColumn = gtk_tree_view_column_new();
gtk_tree_view_column_set_title(middleTreeViewColumn, "M");
gtk_tree_view_append_column(GTK_TREE_VIEW(gTreeViewWidget), middleTreeViewColumn);
GtkTreeViewColumn* lastTreeViewColumn = gtk_tree_view_column_new();
gtk_tree_view_column_set_title(lastTreeViewColumn, "M");
gtk_tree_view_append_column(GTK_TREE_VIEW(gTreeViewWidget), lastTreeViewColumn);
/* Use the middle column's header for our button */
GtkWidget* pTreeHeaderCellWidget = gtk_tree_view_column_get_button(middleTreeViewColumn);
mpTreeHeaderButtonStyle = gtk_widget_get_style_context(pTreeHeaderCellWidget);
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