Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
Material
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
Material
Commits
09fdc471
Unverified
Commit
09fdc471
authored
Sep 03, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
development: added begin and commit methods to Grid for transactional calculations
parent
77eee758
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
6 deletions
+15
-6
Sources/iOS/ControlView.swift
+2
-3
Sources/iOS/Grid.swift
+11
-0
Sources/iOS/NavigationBar.swift
+2
-3
No files found.
Sources/iOS/ControlView.swift
View file @
09fdc471
...
...
@@ -171,7 +171,7 @@ open class ControlView: View {
let
p
=
width
-
l
-
r
-
contentEdgeInsets
.
left
-
contentEdgeInsets
.
right
let
columns
=
Int
(
p
/
gridFactor
)
grid
.
deferred
=
true
grid
.
begin
()
grid
.
views
.
removeAll
()
grid
.
axis
.
columns
=
columns
...
...
@@ -209,8 +209,7 @@ open class ControlView: View {
contentView
.
grid
.
columns
=
columns
-
lc
-
rc
}
grid
.
deferred
=
false
grid
.
reload
()
grid
.
commit
()
}
}
...
...
Sources/iOS/Grid.swift
View file @
09fdc471
...
...
@@ -197,6 +197,17 @@ public class Grid {
axis
=
GridAxis
(
grid
:
self
)
}
/// Begins a deferred block.
public
func
begin
()
{
deferred
=
true
}
/// Completes a deferred block.
public
func
commit
()
{
deferred
=
false
reload
()
}
/// Reload the button layout.
public
func
reload
()
{
guard
!
deferred
else
{
...
...
Sources/iOS/NavigationBar.swift
View file @
09fdc471
...
...
@@ -204,7 +204,7 @@ open class NavigationBar: UINavigationBar {
let
p
=
width
-
l
-
r
-
contentEdgeInsets
.
left
-
contentEdgeInsets
.
right
let
columns
=
Int
(
p
/
gridFactor
)
item
.
titleView
!.
grid
.
deferred
=
true
item
.
titleView
!.
grid
.
begin
()
item
.
titleView
!.
grid
.
views
.
removeAll
()
item
.
titleView
!.
grid
.
axis
.
columns
=
columns
...
...
@@ -244,8 +244,7 @@ open class NavigationBar: UINavigationBar {
item
.
titleView
!.
grid
.
interimSpace
=
interimSpace
item
.
titleView
!.
grid
.
contentEdgeInsets
=
contentEdgeInsets
item
.
titleView
!.
grid
.
deferred
=
false
item
.
titleView
!.
grid
.
reload
()
item
.
titleView
!.
grid
.
commit
()
// contentView alignment.
if
nil
!=
item
.
title
&&
""
!=
item
.
title
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment