Skip to content

Commit 7a73e8d

Browse files
committed
thenIf
1 parent 4e6203f commit 7a73e8d

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

  • core/ui/src/main/kotlin/com/t8rin/imagetoolbox/core/ui/widget/modifier
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* ImageToolbox is an image editor for android
3+
* Copyright (c) 2025 T8RIN (Malik Mukhametzyanov)
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
*
8+
* Unless required by applicable law or agreed to in writing, software
9+
* distributed under the License is distributed on an "AS IS" BASIS,
10+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
* See the License for the specific language governing permissions and
12+
* limitations under the License.
13+
*
14+
* You should have received a copy of the Apache License
15+
* along with this program. If not, see <http://www.apache.org/licenses/LICENSE-2.0>.
16+
*/
17+
18+
package com.t8rin.imagetoolbox.core.ui.widget.modifier
19+
20+
import androidx.compose.ui.Modifier
21+
22+
inline fun Modifier.thenIf(
23+
condition: Boolean,
24+
block: Modifier.() -> Modifier
25+
): Modifier = if (condition) then(Modifier.block()) else this

0 commit comments

Comments
 (0)