forked from mbk-lab/rui_orig
2
0
Fork 0

Added the "overflow" property

This commit is contained in:
Alexei Anoshenko 2022-07-27 13:26:36 +03:00
parent fdbb6cb00b
commit ece1d04e4e
6 changed files with 125 additions and 2 deletions

View File

@ -1,5 +1,12 @@
# v0.8.0 # v0.8.0
* Requared go 1.18
* The "interface{}" type replaced by "any"
* Added the "overflow" property
* Added the GetOverflow function
# v0.8.0
* Added "loaded-event" and "error-event" events to ImageView * Added "loaded-event" and "error-event" events to ImageView
* Added NaturalSize and CurrentSource methods to ImageView * Added NaturalSize and CurrentSource methods to ImageView
* Added "user-select" property and IsUserSelect function * Added "user-select" property and IsUserSelect function

View File

@ -45,6 +45,12 @@ const (
// Opacity is the degree to which content behind an element is hidden, and is the opposite of transparency. // Opacity is the degree to which content behind an element is hidden, and is the opposite of transparency.
Opacity = "opacity" Opacity = "opacity"
// Overflow is the constant for the "overflow" property tag.
// The "overflow" int property sets the desired behavior for an element's overflow — i.e.
// when an element's content is too big to fit in its block formatting context — in both directions.
// Valid values: OverflowHidden (0), OverflowVisible (1), OverflowScroll (2), OverflowAuto (3)
Overflow = "overflow"
// Row is the constant for the "row" property tag. // Row is the constant for the "row" property tag.
Row = "row" Row = "row"

View File

@ -179,6 +179,11 @@ var enumProperties = map[string]struct {
"", "",
[]string{"visible", "invisible", "gone"}, []string{"visible", "invisible", "gone"},
}, },
Overflow: {
[]string{"hidden", "visible", "scroll", "auto"},
Overflow,
[]string{"hidden", "visible", "scroll", "auto"},
},
TextAlign: { TextAlign: {
[]string{"left", "right", "center", "justify"}, []string{"left", "right", "center", "justify"},
TextAlign, TextAlign,

View File

@ -3,29 +3,57 @@ package rui
const ( const (
// Visible - default value of the view Visibility property: View is visible // Visible - default value of the view Visibility property: View is visible
Visible = 0 Visible = 0
// Invisible - value of the view Visibility property: View is invisible but takes place // Invisible - value of the view Visibility property: View is invisible but takes place
Invisible = 1 Invisible = 1
// Gone - value of the view Visibility property: View is invisible and does not take place // Gone - value of the view Visibility property: View is invisible and does not take place
Gone = 2 Gone = 2
// OverflowHidden - value of the view "overflow" property:
// Content is clipped if necessary to fit the padding box. No scrollbars are provided,
// and no support for allowing the user to scroll (such as by dragging or using a scroll wheel) is allowed.
// The content can be scrolled programmatically, so the element is still a scroll container.
OverflowHidden = 0
// OverflowVisible - value of the view "overflow" property:
// Content is not clipped and may be rendered outside the padding box.
OverflowVisible = 1
// OverflowScroll - value of the view "overflow" property:
// Content is clipped if necessary to fit the padding box. Browsers always display scrollbars whether or
// not any content is actually clipped, preventing scrollbars from appearing or disappearing as content changes.
OverflowScroll = 2
// OverflowAuto - value of the view "overflow" property:
// Depends on the browser user agent. If content fits inside the padding box, it looks the same as OverflowVisible,
// but still establishes a new block formatting context. Desktop browsers provide scrollbars if content overflows.
OverflowAuto = 3
// NoneTextTransform - not transform text // NoneTextTransform - not transform text
NoneTextTransform = 0 NoneTextTransform = 0
// CapitalizeTextTransform - capitalize text // CapitalizeTextTransform - capitalize text
CapitalizeTextTransform = 1 CapitalizeTextTransform = 1
// LowerCaseTextTransform - transform text to lower case // LowerCaseTextTransform - transform text to lower case
LowerCaseTextTransform = 2 LowerCaseTextTransform = 2
// UpperCaseTextTransform - transform text to upper case // UpperCaseTextTransform - transform text to upper case
UpperCaseTextTransform = 3 UpperCaseTextTransform = 3
// HorizontalTopToBottom - content flows horizontally from left to right, vertically from top to bottom. // HorizontalTopToBottom - content flows horizontally from left to right, vertically from top to bottom.
// The next horizontal line is positioned below the previous line. // The next horizontal line is positioned below the previous line.
HorizontalTopToBottom = 0 HorizontalTopToBottom = 0
// HorizontalBottomToTop - content flows horizontally from left to right, vertically from bottom to top. // HorizontalBottomToTop - content flows horizontally from left to right, vertically from bottom to top.
// The next horizontal line is positioned above the previous line. // The next horizontal line is positioned above the previous line.
HorizontalBottomToTop = 1 HorizontalBottomToTop = 1
// VerticalRightToLeft - content flows vertically from top to bottom, horizontally from right to left. // VerticalRightToLeft - content flows vertically from top to bottom, horizontally from right to left.
// The next vertical line is positioned to the left of the previous line. // The next vertical line is positioned to the left of the previous line.
VerticalRightToLeft = 2 VerticalRightToLeft = 2
// VerticalLeftToRight - content flows vertically from top to bottom, horizontally from left to right. // VerticalLeftToRight - content flows vertically from top to bottom, horizontally from left to right.
// The next vertical line is positioned to the right of the previous line. // The next vertical line is positioned to the right of the previous line.
VerticalLeftToRight = 3 VerticalLeftToRight = 3
@ -33,6 +61,7 @@ const (
// MixedTextOrientation - rotates the characters of horizontal scripts 90° clockwise. // MixedTextOrientation - rotates the characters of horizontal scripts 90° clockwise.
// Lays out the characters of vertical scripts naturally. Default value. // Lays out the characters of vertical scripts naturally. Default value.
MixedTextOrientation = 0 MixedTextOrientation = 0
// UprightTextOrientation - lays out the characters of horizontal scripts naturally (upright), // UprightTextOrientation - lays out the characters of horizontal scripts naturally (upright),
// as well as the glyphs for vertical scripts. Note that this keyword causes all characters // as well as the glyphs for vertical scripts. Note that this keyword causes all characters
// to be considered as left-to-right: the used value of "text-direction" is forced to be "left-to-right". // to be considered as left-to-right: the used value of "text-direction" is forced to be "left-to-right".
@ -40,62 +69,84 @@ const (
// SystemTextDirection - direction of a text and other elements defined by system. This is the default value. // SystemTextDirection - direction of a text and other elements defined by system. This is the default value.
SystemTextDirection = 0 SystemTextDirection = 0
// LeftToRightDirection - text and other elements go from left to right. // LeftToRightDirection - text and other elements go from left to right.
LeftToRightDirection = 1 LeftToRightDirection = 1
//RightToLeftDirection - text and other elements go from right to left. //RightToLeftDirection - text and other elements go from right to left.
RightToLeftDirection = 2 RightToLeftDirection = 2
// ThinFont - the value of "text-weight" property: the thin (hairline) text weight // ThinFont - the value of "text-weight" property: the thin (hairline) text weight
ThinFont = 1 ThinFont = 1
// ExtraLightFont - the value of "text-weight" property: the extra light (ultra light) text weight // ExtraLightFont - the value of "text-weight" property: the extra light (ultra light) text weight
ExtraLightFont = 2 ExtraLightFont = 2
// LightFont - the value of "text-weight" property: the light text weight // LightFont - the value of "text-weight" property: the light text weight
LightFont = 3 LightFont = 3
// NormalFont - the value of "text-weight" property (default value): the normal text weight // NormalFont - the value of "text-weight" property (default value): the normal text weight
NormalFont = 4 NormalFont = 4
// MediumFont - the value of "text-weight" property: the medium text weight // MediumFont - the value of "text-weight" property: the medium text weight
MediumFont = 5 MediumFont = 5
// SemiBoldFont - the value of "text-weight" property: the semi bold (demi bold) text weight // SemiBoldFont - the value of "text-weight" property: the semi bold (demi bold) text weight
SemiBoldFont = 6 SemiBoldFont = 6
// BoldFont - the value of "text-weight" property: the bold text weight // BoldFont - the value of "text-weight" property: the bold text weight
BoldFont = 7 BoldFont = 7
// ExtraBoldFont - the value of "text-weight" property: the extra bold (ultra bold) text weight // ExtraBoldFont - the value of "text-weight" property: the extra bold (ultra bold) text weight
ExtraBoldFont = 8 ExtraBoldFont = 8
// BlackFont - the value of "text-weight" property: the black (heavy) text weight // BlackFont - the value of "text-weight" property: the black (heavy) text weight
BlackFont = 9 BlackFont = 9
// TopAlign - top vertical-align for the "vertical-align" property // TopAlign - top vertical-align for the "vertical-align" property
TopAlign = 0 TopAlign = 0
// BottomAlign - bottom vertical-align for the "vertical-align" property // BottomAlign - bottom vertical-align for the "vertical-align" property
BottomAlign = 1 BottomAlign = 1
// LeftAlign - the left horizontal-align for the "horizontal-align" property // LeftAlign - the left horizontal-align for the "horizontal-align" property
LeftAlign = 0 LeftAlign = 0
// RightAlign - the right horizontal-align for the "horizontal-align" property // RightAlign - the right horizontal-align for the "horizontal-align" property
RightAlign = 1 RightAlign = 1
// CenterAlign - the center horizontal/vertical-align for the "horizontal-align"/"vertical-align" property // CenterAlign - the center horizontal/vertical-align for the "horizontal-align"/"vertical-align" property
CenterAlign = 2 CenterAlign = 2
// StretchAlign - the stretch horizontal/vertical-align for the "horizontal-align"/"vertical-align" property // StretchAlign - the stretch horizontal/vertical-align for the "horizontal-align"/"vertical-align" property
StretchAlign = 3 StretchAlign = 3
// JustifyAlign - the justify text align for "text-align" property // JustifyAlign - the justify text align for "text-align" property
JustifyAlign = 3 JustifyAlign = 3
// BaselineAlign - the baseline cell-vertical-align for the "cell-vertical-align" property // BaselineAlign - the baseline cell-vertical-align for the "cell-vertical-align" property
BaselineAlign = 4 BaselineAlign = 4
// WhiteSpaceNormal - sequences of white space are collapsed. Newline characters in the source // WhiteSpaceNormal - sequences of white space are collapsed. Newline characters in the source
// are handled the same as other white space. Lines are broken as necessary to fill line boxes. // are handled the same as other white space. Lines are broken as necessary to fill line boxes.
WhiteSpaceNormal = 0 WhiteSpaceNormal = 0
// WhiteSpaceNowrap - collapses white space as for normal, but suppresses line breaks (text wrapping) // WhiteSpaceNowrap - collapses white space as for normal, but suppresses line breaks (text wrapping)
// within the source. // within the source.
WhiteSpaceNowrap = 1 WhiteSpaceNowrap = 1
// WhiteSpacePre - sequences of white space are preserved. Lines are only broken at newline // WhiteSpacePre - sequences of white space are preserved. Lines are only broken at newline
// characters in the source and at <br> elements. // characters in the source and at <br> elements.
WhiteSpacePre = 2 WhiteSpacePre = 2
// WhiteSpacePreWrap - Sequences of white space are preserved. Lines are broken at newline // WhiteSpacePreWrap - Sequences of white space are preserved. Lines are broken at newline
// characters, at <br>, and as necessary to fill line boxes. // characters, at <br>, and as necessary to fill line boxes.
WhiteSpacePreWrap = 3 WhiteSpacePreWrap = 3
// WhiteSpacePreLine - sequences of white space are collapsed. Lines are broken at newline characters, // WhiteSpacePreLine - sequences of white space are collapsed. Lines are broken at newline characters,
// at <br>, and as necessary to fill line boxes. // at <br>, and as necessary to fill line boxes.
WhiteSpacePreLine = 4 WhiteSpacePreLine = 4
// WhiteSpaceBreakSpaces - the behavior is identical to that of WhiteSpacePreWrap, except that: // WhiteSpaceBreakSpaces - the behavior is identical to that of WhiteSpacePreWrap, except that:
// * Any sequence of preserved white space always takes up space, including at the end of the line. // * Any sequence of preserved white space always takes up space, including at the end of the line.
// * A line breaking opportunity exists after every preserved white space character, including between white space characters. // * A line breaking opportunity exists after every preserved white space character, including between white space characters.
@ -104,12 +155,15 @@ const (
// WordBreakNormal - use the default line break rule. // WordBreakNormal - use the default line break rule.
WordBreakNormal = 0 WordBreakNormal = 0
// WordBreakAll - to prevent overflow, word breaks should be inserted between any two characters // WordBreakAll - to prevent overflow, word breaks should be inserted between any two characters
// (excluding Chinese/Japanese/Korean text). // (excluding Chinese/Japanese/Korean text).
WordBreakAll = 1 WordBreakAll = 1
// WordBreakKeepAll - word breaks should not be used for Chinese/Japanese/Korean (CJK) text. // WordBreakKeepAll - word breaks should not be used for Chinese/Japanese/Korean (CJK) text.
// Non-CJK text behavior is the same as for normal. // Non-CJK text behavior is the same as for normal.
WordBreakKeepAll = 2 WordBreakKeepAll = 2
// WordBreakWord - when the block boundaries are exceeded, the remaining whole words can be split // WordBreakWord - when the block boundaries are exceeded, the remaining whole words can be split
// in an arbitrary place, unless a more suitable place for the line break is found. // in an arbitrary place, unless a more suitable place for the line break is found.
WordBreakWord = 3 WordBreakWord = 3
@ -117,6 +171,7 @@ const (
// TextOverflowClip - truncate the text at the limit of the content area, therefore the truncation // TextOverflowClip - truncate the text at the limit of the content area, therefore the truncation
// can happen in the middle of a character. // can happen in the middle of a character.
TextOverflowClip = 0 TextOverflowClip = 0
// TextOverflowEllipsis - display an ellipsis ('…', U+2026 HORIZONTAL ELLIPSIS) to represent clipped text. // TextOverflowEllipsis - display an ellipsis ('…', U+2026 HORIZONTAL ELLIPSIS) to represent clipped text.
// The ellipsis is displayed inside the content area, decreasing the amount of text displayed. // The ellipsis is displayed inside the content area, decreasing the amount of text displayed.
// If there is not enough space to display the ellipsis, it is clipped. // If there is not enough space to display the ellipsis, it is clipped.
@ -124,87 +179,111 @@ const (
// DefaultSemantics - default value of the view Semantic property // DefaultSemantics - default value of the view Semantic property
DefaultSemantics = 0 DefaultSemantics = 0
// ArticleSemantics - value of the view Semantic property: view represents a self-contained // ArticleSemantics - value of the view Semantic property: view represents a self-contained
// composition in a document, page, application, or site, which is intended to be // composition in a document, page, application, or site, which is intended to be
// independently distributable or reusable (e.g., in syndication) // independently distributable or reusable (e.g., in syndication)
ArticleSemantics = 1 ArticleSemantics = 1
// SectionSemantics - value of the view Semantic property: view represents // SectionSemantics - value of the view Semantic property: view represents
// a generic standalone section of a document, which doesn't have a more specific // a generic standalone section of a document, which doesn't have a more specific
// semantic element to represent it. // semantic element to represent it.
SectionSemantics = 2 SectionSemantics = 2
// AsideSemantics - value of the view Semantic property: view represents a portion // AsideSemantics - value of the view Semantic property: view represents a portion
// of a document whose content is only indirectly related to the document's main content. // of a document whose content is only indirectly related to the document's main content.
// Asides are frequently presented as sidebars or call-out boxes. // Asides are frequently presented as sidebars or call-out boxes.
AsideSemantics = 3 AsideSemantics = 3
// HeaderSemantics - value of the view Semantic property: view represents introductory // HeaderSemantics - value of the view Semantic property: view represents introductory
// content, typically a group of introductory or navigational aids. It may contain // content, typically a group of introductory or navigational aids. It may contain
// some heading elements but also a logo, a search form, an author name, and other elements. // some heading elements but also a logo, a search form, an author name, and other elements.
HeaderSemantics = 4 HeaderSemantics = 4
// MainSemantics - value of the view Semantic property: view represents the dominant content // MainSemantics - value of the view Semantic property: view represents the dominant content
// of the application. The main content area consists of content that is directly related // of the application. The main content area consists of content that is directly related
// to or expands upon the central topic of a document, or the central functionality of an application. // to or expands upon the central topic of a document, or the central functionality of an application.
MainSemantics = 5 MainSemantics = 5
// FooterSemantics - value of the view Semantic property: view represents a footer for its // FooterSemantics - value of the view Semantic property: view represents a footer for its
// nearest sectioning content or sectioning root element. A footer view typically contains // nearest sectioning content or sectioning root element. A footer view typically contains
// information about the author of the section, copyright data or links to related documents. // information about the author of the section, copyright data or links to related documents.
FooterSemantics = 6 FooterSemantics = 6
// NavigationSemantics - value of the view Semantic property: view represents a section of // NavigationSemantics - value of the view Semantic property: view represents a section of
// a page whose purpose is to provide navigation links, either within the current document // a page whose purpose is to provide navigation links, either within the current document
// or to other documents. Common examples of navigation sections are menus, tables of contents, // or to other documents. Common examples of navigation sections are menus, tables of contents,
// and indexes. // and indexes.
NavigationSemantics = 7 NavigationSemantics = 7
// FigureSemantics - value of the view Semantic property: view represents self-contained content, // FigureSemantics - value of the view Semantic property: view represents self-contained content,
// potentially with an optional caption, which is specified using the FigureCaptionSemantics view. // potentially with an optional caption, which is specified using the FigureCaptionSemantics view.
FigureSemantics = 8 FigureSemantics = 8
// FigureCaptionSemantics - value of the view Semantic property: view represents a caption or // FigureCaptionSemantics - value of the view Semantic property: view represents a caption or
// legend describing the rest of the contents of its parent FigureSemantics view. // legend describing the rest of the contents of its parent FigureSemantics view.
FigureCaptionSemantics = 9 FigureCaptionSemantics = 9
// ButtonSemantics - value of the view Semantic property: view a clickable button // ButtonSemantics - value of the view Semantic property: view a clickable button
ButtonSemantics = 10 ButtonSemantics = 10
// ParagraphSemantics - value of the view Semantic property: view represents a paragraph. // ParagraphSemantics - value of the view Semantic property: view represents a paragraph.
// Paragraphs are usually represented in visual media as blocks of text separated // Paragraphs are usually represented in visual media as blocks of text separated
// from adjacent blocks by blank lines and/or first-line indentation // from adjacent blocks by blank lines and/or first-line indentation
ParagraphSemantics = 11 ParagraphSemantics = 11
// H1Semantics - value of the view Semantic property: view represent of first level section headings. // H1Semantics - value of the view Semantic property: view represent of first level section headings.
// H1Semantics is the highest section level and H6Semantics is the lowest. // H1Semantics is the highest section level and H6Semantics is the lowest.
H1Semantics = 12 H1Semantics = 12
// H2Semantics - value of the view Semantic property: view represent of second level section headings. // H2Semantics - value of the view Semantic property: view represent of second level section headings.
// H1Semantics is the highest section level and H6Semantics is the lowest. // H1Semantics is the highest section level and H6Semantics is the lowest.
H2Semantics = 13 H2Semantics = 13
// H3Semantics - value of the view Semantic property: view represent of third level section headings. // H3Semantics - value of the view Semantic property: view represent of third level section headings.
// H1Semantics is the highest section level and H6Semantics is the lowest. // H1Semantics is the highest section level and H6Semantics is the lowest.
H3Semantics = 14 H3Semantics = 14
// H4Semantics - value of the view Semantic property: view represent of fourth level section headings. // H4Semantics - value of the view Semantic property: view represent of fourth level section headings.
// H1Semantics is the highest section level and H6Semantics is the lowest. // H1Semantics is the highest section level and H6Semantics is the lowest.
H4Semantics = 15 H4Semantics = 15
// H5Semantics - value of the view Semantic property: view represent of fifth level section headings. // H5Semantics - value of the view Semantic property: view represent of fifth level section headings.
// H1Semantics is the highest section level and H6Semantics is the lowest. // H1Semantics is the highest section level and H6Semantics is the lowest.
H5Semantics = 16 H5Semantics = 16
// H6Semantics - value of the view Semantic property: view represent of sixth level section headings. // H6Semantics - value of the view Semantic property: view represent of sixth level section headings.
// H1Semantics is the highest section level and H6Semantics is the lowest. // H1Semantics is the highest section level and H6Semantics is the lowest.
H6Semantics = 17 H6Semantics = 17
// BlockquoteSemantics - value of the view Semantic property: view indicates that // BlockquoteSemantics - value of the view Semantic property: view indicates that
// the enclosed text is an extended quotation. // the enclosed text is an extended quotation.
BlockquoteSemantics = 18 BlockquoteSemantics = 18
// CodeSemantics - value of the view Semantic property: view displays its contents styled // CodeSemantics - value of the view Semantic property: view displays its contents styled
// in a fashion intended to indicate that the text is a short fragment of computer code // in a fashion intended to indicate that the text is a short fragment of computer code
CodeSemantics = 19 CodeSemantics = 19
// NoneFloat - value of the view "float" property: the View must not float. // NoneFloat - value of the view "float" property: the View must not float.
NoneFloat = 0 NoneFloat = 0
// LeftFloat - value of the view "float" property: the View must float on the left side of its containing block. // LeftFloat - value of the view "float" property: the View must float on the left side of its containing block.
LeftFloat = 1 LeftFloat = 1
// RightFloat - value of the view "float" property: the View must float on the right side of its containing block. // RightFloat - value of the view "float" property: the View must float on the right side of its containing block.
RightFloat = 2 RightFloat = 2
// NoneResize - value of the view "resize" property: the View The offers no user-controllable method for resizing it. // NoneResize - value of the view "resize" property: the View The offers no user-controllable method for resizing it.
NoneResize = 0 NoneResize = 0
// BothResize - value of the view "resize" property: the View displays a mechanism for allowing // BothResize - value of the view "resize" property: the View displays a mechanism for allowing
// the user to resize it, which may be resized both horizontally and vertically. // the user to resize it, which may be resized both horizontally and vertically.
BothResize = 1 BothResize = 1
// HorizontalResize - value of the view "resize" property: the View displays a mechanism for allowing // HorizontalResize - value of the view "resize" property: the View displays a mechanism for allowing
// the user to resize it in the horizontal direction. // the user to resize it in the horizontal direction.
HorizontalResize = 2 HorizontalResize = 2
// VerticalResize - value of the view "resize" property: the View displays a mechanism for allowing // VerticalResize - value of the view "resize" property: the View displays a mechanism for allowing
// the user to resize it in the vertical direction. // the user to resize it in the vertical direction.
VerticalResize = 3 VerticalResize = 3
@ -212,14 +291,17 @@ const (
// RowAutoFlow - value of the "grid-auto-flow" property of the GridLayout: // RowAutoFlow - value of the "grid-auto-flow" property of the GridLayout:
// Views are placed by filling each row in turn, adding new rows as necessary. // Views are placed by filling each row in turn, adding new rows as necessary.
RowAutoFlow = 0 RowAutoFlow = 0
// ColumnAutoFlow - value of the "grid-auto-flow" property of the GridLayout: // ColumnAutoFlow - value of the "grid-auto-flow" property of the GridLayout:
// Views are placed by filling each column in turn, adding new columns as necessary. // Views are placed by filling each column in turn, adding new columns as necessary.
ColumnAutoFlow = 1 ColumnAutoFlow = 1
// RowDenseAutoFlow - value of the "grid-auto-flow" property of the GridLayout: // RowDenseAutoFlow - value of the "grid-auto-flow" property of the GridLayout:
// Views are placed by filling each row, adding new rows as necessary. // Views are placed by filling each row, adding new rows as necessary.
// "dense" packing algorithm attempts to fill in holes earlier in the grid, if smaller items come up later. // "dense" packing algorithm attempts to fill in holes earlier in the grid, if smaller items come up later.
// This may cause views to appear out-of-order, when doing so would fill in holes left by larger views. // This may cause views to appear out-of-order, when doing so would fill in holes left by larger views.
RowDenseAutoFlow = 2 RowDenseAutoFlow = 2
// ColumnDenseAutoFlow - value of the "grid-auto-flow" property of the GridLayout: // ColumnDenseAutoFlow - value of the "grid-auto-flow" property of the GridLayout:
// Views are placed by filling each column, adding new columns as necessary. // Views are placed by filling each column, adding new columns as necessary.
// "dense" packing algorithm attempts to fill in holes earlier in the grid, if smaller items come up later. // "dense" packing algorithm attempts to fill in holes earlier in the grid, if smaller items come up later.

View File

@ -235,7 +235,7 @@ func (style *viewStyle) cssViewStyle(builder cssBuilder, session Session) {
writingMode := 0 writingMode := 0
for _, tag := range []string{ for _, tag := range []string{
TextAlign, TextTransform, TextWeight, TextLineStyle, WritingMode, TextDirection, Overflow, TextAlign, TextTransform, TextWeight, TextLineStyle, WritingMode, TextDirection,
VerticalTextOrientation, CellVerticalAlign, CellHorizontalAlign, GridAutoFlow, Cursor, VerticalTextOrientation, CellVerticalAlign, CellHorizontalAlign, GridAutoFlow, Cursor,
WhiteSpace, WordBreak, TextOverflow, Float, TableVerticalAlign, Resize} { WhiteSpace, WordBreak, TextOverflow, Float, TableVerticalAlign, Resize} {

View File

@ -156,6 +156,30 @@ func GetVisibility(view View, subviewID string) int {
return result return result
} }
// GetOverflow returns a value of the subview "overflow" property. Returns one of next values:
// OverflowHidden (0), OverflowVisible (1), OverflowScroll (2), OverflowAuto (3)
// If the second argument (subviewID) is "" then a value of the first argument (view) is returned
func GetOverflow(view View, subviewID string) int {
if subviewID != "" {
view = ViewByID(view, subviewID)
}
if view == nil {
return OverflowHidden
}
defaultOverflow := OverflowHidden
switch view.(type) {
case EditView:
defaultOverflow = OverflowAuto
case ListView:
defaultOverflow = OverflowAuto
}
result, _ := enumStyledProperty(view, Overflow, defaultOverflow)
return result
}
// GetZIndex returns the subview z-order. // GetZIndex returns the subview z-order.
// If the second argument (subviewID) is "" then a z-order of the first argument (view) is returned // If the second argument (subviewID) is "" then a z-order of the first argument (view) is returned
func GetZIndex(view View, subviewID string) int { func GetZIndex(view View, subviewID string) int {
@ -479,7 +503,6 @@ func GetTextSize(view View, subviewID string) SizeUnit {
// GetTextWeight returns a text weight of the subview. Returns one of next values: // GetTextWeight returns a text weight of the subview. Returns one of next values:
// 1, 2, 3, 4 (normal text), 5, 6, 7 (bold text), 8 and 9 // 1, 2, 3, 4 (normal text), 5, 6, 7 (bold text), 8 and 9
// If the second argument (subviewID) is "" then a value from the first argument (view) is returned. // If the second argument (subviewID) is "" then a value from the first argument (view) is returned.
// If the second argument (subviewID) is "" then a value from the first argument (view) is returned.
func GetTextWeight(view View, subviewID string) int { func GetTextWeight(view View, subviewID string) int {
if subviewID != "" { if subviewID != "" {
view = ViewByID(view, subviewID) view = ViewByID(view, subviewID)