V1
@@ -0,0 +1,237 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Knee Function Adjustment</title>
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 20px;
|
||||
margin: 20px 0;
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
canvas {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.slider-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 15px;
|
||||
margin: 20px;
|
||||
}
|
||||
|
||||
.slider {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.slider input {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.image-wrapper {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.image-wrapper canvas {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.file-input {
|
||||
margin: 20px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Knee Function Adjustment</h1>
|
||||
|
||||
<div class="file-input">
|
||||
<label for="fileInput">Choose an image:</label>
|
||||
<input type="file" id="fileInput" accept="image/*">
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<div class="image-wrapper">
|
||||
<h3>Original Image</h3>
|
||||
<canvas id="originalCanvas"></canvas>
|
||||
<p id="originalGrayLabel">Avg Gray: 0.00</p>
|
||||
</div>
|
||||
|
||||
<div class="image-wrapper">
|
||||
<h3>Processed Image</h3>
|
||||
<canvas id="processedCanvas"></canvas>
|
||||
<p id="processedGrayLabel">Avg Gray: 0.00</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="slider-container">
|
||||
<div class="slider">
|
||||
<label for="sensorOutput1">Sensor Output Shadow</label>
|
||||
<input type="range" id="sensorOutput1" min="0" max="255" value="25">
|
||||
</div>
|
||||
|
||||
<div class="slider">
|
||||
<label for="mappedOutput1">Mapped Output Shadow</label>
|
||||
<input type="range" id="mappedOutput1" min="0" max="255" value="50">
|
||||
</div>
|
||||
|
||||
<div class="slider">
|
||||
<label for="sensorOutput2">Sensor Output Bright</label>
|
||||
<input type="range" id="sensorOutput2" min="0" max="255" value="200">
|
||||
</div>
|
||||
|
||||
<div class="slider">
|
||||
<label for="mappedOutput2">Mapped Output Bright</label>
|
||||
<input type="range" id="mappedOutput2" min="0" max="255" value="200">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3>Knee Function Graph</h3>
|
||||
<canvas id="kneeGraph"></canvas>
|
||||
|
||||
<script>
|
||||
const originalCanvas = document.getElementById('originalCanvas');
|
||||
const processedCanvas = document.getElementById('processedCanvas');
|
||||
const kneeGraph = document.getElementById('kneeGraph');
|
||||
|
||||
const originalGrayLabel = document.getElementById('originalGrayLabel');
|
||||
const processedGrayLabel = document.getElementById('processedGrayLabel');
|
||||
|
||||
const sensorOutput1 = document.getElementById('sensorOutput1');
|
||||
const mappedOutput1 = document.getElementById('mappedOutput1');
|
||||
const sensorOutput2 = document.getElementById('sensorOutput2');
|
||||
const mappedOutput2 = document.getElementById('mappedOutput2');
|
||||
|
||||
const fileInput = document.getElementById('fileInput');
|
||||
|
||||
let imageArray = null;
|
||||
|
||||
function drawImage(canvas, imageArray, imgWidth, imgHeight) {
|
||||
const ctx = canvas.getContext('2d');
|
||||
|
||||
// Set the canvas size according to the image aspect ratio
|
||||
const aspectRatio = imgWidth / imgHeight;
|
||||
const canvasWidth = 500; // Set the desired width for the canvas
|
||||
const canvasHeight = canvasWidth / aspectRatio;
|
||||
|
||||
canvas.width = canvasWidth;
|
||||
canvas.height = canvasHeight;
|
||||
|
||||
const imageData = ctx.createImageData(canvasWidth, canvasHeight);
|
||||
for (let i = 0; i < imageArray.length; i++) {
|
||||
imageData.data[i * 4] = imageData.data[i * 4 + 1] = imageData.data[i * 4 + 2] = imageArray[i];
|
||||
imageData.data[i * 4 + 3] = 255; // Alpha channel
|
||||
}
|
||||
ctx.putImageData(imageData, 0, 0);
|
||||
}
|
||||
|
||||
function applyKnee(imageArray, kneeLevel, kneeSlope) {
|
||||
return imageArray.map(value =>
|
||||
value > kneeLevel ? kneeLevel + (value - kneeLevel) * kneeSlope : value
|
||||
);
|
||||
}
|
||||
|
||||
function calculateAverageGray(imageArray) {
|
||||
return (imageArray.reduce((sum, value) => sum + value, 0) / imageArray.length).toFixed(2);
|
||||
}
|
||||
|
||||
function update() {
|
||||
if (!imageArray) return;
|
||||
|
||||
const sensor1 = parseInt(sensorOutput1.value);
|
||||
const map1 = parseInt(mappedOutput1.value);
|
||||
const sensor2 = parseInt(sensorOutput2.value);
|
||||
const map2 = parseInt(mappedOutput2.value);
|
||||
|
||||
const kneeLevel = map1;
|
||||
const kneeSlope = sensor2 === sensor1 ? 0 : (map2 - map1) / (sensor2 - sensor1);
|
||||
|
||||
const processedArray = applyKnee(imageArray, kneeLevel, kneeSlope);
|
||||
|
||||
drawImage(originalCanvas, imageArray, 256, 256); // Adjust this to the actual image size
|
||||
drawImage(processedCanvas, processedArray, 256, 256); // Adjust this to the actual image size
|
||||
|
||||
originalGrayLabel.textContent = `Avg Gray: ${calculateAverageGray(imageArray)}`;
|
||||
processedGrayLabel.textContent = `Avg Gray: ${calculateAverageGray(processedArray)}`;
|
||||
|
||||
updateKneeGraph(kneeLevel, kneeSlope);
|
||||
}
|
||||
|
||||
function updateKneeGraph(kneeLevel, kneeSlope) {
|
||||
const x = Array.from({ length: 256 }, (_, i) => i);
|
||||
const y = x.map(value =>
|
||||
value > kneeLevel ? kneeLevel + (value - kneeLevel) * kneeSlope : value
|
||||
);
|
||||
|
||||
const ctx = kneeGraph.getContext('2d');
|
||||
kneeGraph.width = 512;
|
||||
kneeGraph.height = 256;
|
||||
ctx.clearRect(0, 0, kneeGraph.width, kneeGraph.height);
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 256);
|
||||
x.forEach((value, i) => {
|
||||
ctx.lineTo(value * 2, 256 - y[i]);
|
||||
});
|
||||
ctx.strokeStyle = 'blue';
|
||||
ctx.lineWidth = 2;
|
||||
ctx.stroke();
|
||||
}
|
||||
|
||||
function loadImage(file) {
|
||||
const img = new Image();
|
||||
img.onload = () => {
|
||||
const canvas = document.createElement('canvas');
|
||||
const ctx = canvas.getContext('2d');
|
||||
canvas.width = img.width;
|
||||
canvas.height = img.height;
|
||||
ctx.drawImage(img, 0, 0);
|
||||
|
||||
const imageData = ctx.getImageData(0, 0, img.width, img.height);
|
||||
imageArray = new Uint8Array(img.width * img.height);
|
||||
for (let i = 0; i < imageArray.length; i++) {
|
||||
imageArray[i] = imageData.data[i * 4]; // Grayscale from red channel
|
||||
}
|
||||
|
||||
// Draw original and processed images with aspect ratio
|
||||
drawImage(originalCanvas, imageArray, img.width, img.height);
|
||||
drawImage(processedCanvas, imageArray, img.width, img.height);
|
||||
update();
|
||||
};
|
||||
img.src = URL.createObjectURL(file);
|
||||
}
|
||||
|
||||
fileInput.addEventListener('change', (event) => {
|
||||
const file = event.target.files[0];
|
||||
if (file) {
|
||||
loadImage(file);
|
||||
}
|
||||
});
|
||||
|
||||
[sensorOutput1, mappedOutput1, sensorOutput2, mappedOutput2].forEach(slider => {
|
||||
slider.addEventListener('input', update);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
After Width: | Height: | Size: 1.5 MiB |
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"Version": 1,
|
||||
"WorkspaceRootPath": "C:\\Users\\william\\Documents\\Git\\Knees\\Knees\\",
|
||||
"Documents": [
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{4A05E730-1BDC-41C2-BCD1-FBA1BDBD0C1E}|Knees.pyproj|C:\\Users\\william\\Documents\\Git\\Knees\\Knees\\Knees.py||{8B382828-6202-11D1-8870-0000F87579D2}",
|
||||
"RelativeMoniker": "D:0:0:{4A05E730-1BDC-41C2-BCD1-FBA1BDBD0C1E}|Knees.pyproj|solutionrelative:Knees.py||{8B382828-6202-11D1-8870-0000F87579D2}"
|
||||
}
|
||||
],
|
||||
"DocumentGroupContainers": [
|
||||
{
|
||||
"Orientation": 0,
|
||||
"VerticalTabListWidth": 256,
|
||||
"DocumentGroups": [
|
||||
{
|
||||
"DockedWidth": 200,
|
||||
"SelectedChildIndex": 1,
|
||||
"Children": [
|
||||
{
|
||||
"$type": "Bookmark",
|
||||
"Name": "ST:0:0:{e506b91c-c606-466a-90a9-123d1d1e12b3}"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 0,
|
||||
"Title": "Knees.py",
|
||||
"DocumentMoniker": "C:\\Users\\william\\Documents\\Git\\Knees\\Knees\\Knees.py",
|
||||
"RelativeDocumentMoniker": "Knees.py",
|
||||
"ToolTip": "C:\\Users\\william\\Documents\\Git\\Knees\\Knees\\Knees.py*",
|
||||
"RelativeToolTip": "Knees.py*",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAIAAAAIAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.002457|",
|
||||
"WhenOpened": "2024-12-16T17:11:47.784Z",
|
||||
"EditorCaption": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"Version": 1,
|
||||
"WorkspaceRootPath": "C:\\Users\\william\\Documents\\Git\\Knees\\Knees\\",
|
||||
"Documents": [
|
||||
{
|
||||
"AbsoluteMoniker": "D:0:0:{4A05E730-1BDC-41C2-BCD1-FBA1BDBD0C1E}|Knees.pyproj|C:\\Users\\william\\Documents\\Git\\Knees\\Knees\\Knees.py||{8B382828-6202-11D1-8870-0000F87579D2}",
|
||||
"RelativeMoniker": "D:0:0:{4A05E730-1BDC-41C2-BCD1-FBA1BDBD0C1E}|Knees.pyproj|solutionrelative:Knees.py||{8B382828-6202-11D1-8870-0000F87579D2}"
|
||||
}
|
||||
],
|
||||
"DocumentGroupContainers": [
|
||||
{
|
||||
"Orientation": 0,
|
||||
"VerticalTabListWidth": 256,
|
||||
"DocumentGroups": [
|
||||
{
|
||||
"DockedWidth": 200,
|
||||
"SelectedChildIndex": 1,
|
||||
"Children": [
|
||||
{
|
||||
"$type": "Bookmark",
|
||||
"Name": "ST:0:0:{e506b91c-c606-466a-90a9-123d1d1e12b3}"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 0,
|
||||
"Title": "Knees.py",
|
||||
"DocumentMoniker": "C:\\Users\\william\\Documents\\Git\\Knees\\Knees\\Knees.py",
|
||||
"RelativeDocumentMoniker": "Knees.py",
|
||||
"ToolTip": "C:\\Users\\william\\Documents\\Git\\Knees\\Knees\\Knees.py",
|
||||
"RelativeToolTip": "Knees.py",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAIAAAAIAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.002457|",
|
||||
"WhenOpened": "2024-12-16T17:11:47.784Z",
|
||||
"EditorCaption": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
import tkinter as tk
|
||||
from tkinter import Scale
|
||||
from PIL import Image, ImageTk
|
||||
from matplotlib.figure import Figure
|
||||
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
|
||||
import numpy as np
|
||||
|
||||
|
||||
def calculate_knee_parameters(sensor_output1, mapped_output1, sensor_output2, mapped_output2):
|
||||
# Map inputs from [0, 255] to [0, 4095]
|
||||
in1 = (sensor_output1 << 4) + (sensor_output1 >> 4)
|
||||
out1 = (mapped_output1 << 4) + (mapped_output1 >> 4)
|
||||
in2 = (sensor_output2 << 4) + (sensor_output2 >> 4)
|
||||
out2 = (mapped_output2 << 4) + (mapped_output2 >> 4)
|
||||
|
||||
return in1, out1, in2, out2
|
||||
|
||||
|
||||
def apply_knee_to_array(image_array, in1, out1, in2, out2):
|
||||
# LUT mapping based on the knee function
|
||||
lut = np.zeros(4096, dtype=np.uint16)
|
||||
for i in range(4096):
|
||||
if i <= in1:
|
||||
lut[i] = int(i / in1 * out1)
|
||||
elif i <= in2:
|
||||
lut[i] = int((i - in1) / (in2 - in1) * (out2 - out1) + out1)
|
||||
else:
|
||||
lut[i] = int((i - in2) / (4095 - in2) * (4095 - out2) + out2)
|
||||
lut = np.clip(lut, 0, 4095)
|
||||
|
||||
# Map pixel values using the LUT
|
||||
adjusted_array = lut[(image_array * 4095).astype(int)] / 4095.0
|
||||
return adjusted_array
|
||||
|
||||
|
||||
def update_image():
|
||||
global processed_image_label, processed_image, knee_canvas_dark, knee_canvas_light
|
||||
|
||||
# Get current slider values
|
||||
sensor_output1 = sensor_output1_slider.get()
|
||||
mapped_output1 = mapped_output1_slider.get()
|
||||
sensor_output2 = sensor_output2_slider.get()
|
||||
mapped_output2 = mapped_output2_slider.get()
|
||||
|
||||
# Calculate knee parameters
|
||||
in1, out1, in2, out2 = calculate_knee_parameters(sensor_output1, mapped_output1, sensor_output2, mapped_output2)
|
||||
|
||||
# Apply knee function
|
||||
adjusted_array = apply_knee_to_array(image_array, in1, out1, in2, out2)
|
||||
processed_image = Image.fromarray((adjusted_array * 255).astype(np.uint8))
|
||||
processed_image_resized = processed_image.resize((processed_image.width // 4, processed_image.height // 4))
|
||||
|
||||
# Update the processed image in the GUI
|
||||
processed_image_tk = ImageTk.PhotoImage(processed_image_resized)
|
||||
processed_image_label.configure(image=processed_image_tk)
|
||||
processed_image_label.image = processed_image_tk
|
||||
|
||||
# Calculate and update average gray levels
|
||||
source_avg_gray = np.mean(image_array) * 255
|
||||
processed_avg_gray = np.mean(adjusted_array) * 255
|
||||
source_avg_gray_label.config(text=f"Average Gray Level: {source_avg_gray:.2f}")
|
||||
processed_avg_gray_label.config(text=f"Average Gray Level: {processed_avg_gray:.2f}")
|
||||
|
||||
# Update knee function graphs
|
||||
x = np.linspace(0, 4095, 4096) / 16 # Scale x-axis to 0-255
|
||||
y = np.zeros_like(x)
|
||||
|
||||
for i in range(len(x)):
|
||||
if x[i] <= in1 / 16:
|
||||
y[i] = x[i] / (in1 / 16) * (out1 / 16)
|
||||
elif x[i] <= in2 / 16:
|
||||
y[i] = (x[i] - (in1 / 16)) / ((in2 - in1) / 16) * ((out2 - out1) / 16) + (out1 / 16)
|
||||
else:
|
||||
y[i] = (x[i] - (in2 / 16)) / ((4095 - in2) / 16) * ((255 - (out2 / 16))) + (out2 / 16)
|
||||
|
||||
# Plot dark knee graph
|
||||
knee_ax_dark.clear()
|
||||
knee_ax_dark.plot(x, y, label="Knee Function", color="blue")
|
||||
knee_ax_dark.axvline(in1 / 16, color="red", linestyle="--", label="Knee Point 1")
|
||||
knee_ax_dark.axvline(in2 / 16, color="green", linestyle="--", label="Knee Point 2")
|
||||
knee_ax_dark.set_title("Knee Function")
|
||||
knee_ax_dark.set_xlabel("Input (0-255)")
|
||||
knee_ax_dark.set_ylabel("Output (0-255)")
|
||||
knee_ax_dark.set_xlim(0, 255)
|
||||
knee_ax_dark.set_ylim(0, 255)
|
||||
knee_ax_dark.legend()
|
||||
knee_canvas_dark.draw()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
root = tk.Tk()
|
||||
root.title("Knees Demo Tool V1.1")
|
||||
root.iconbitmap(default='Resources/icon1.ico')
|
||||
root.tk.call("source", "Resources/azure.tcl")
|
||||
root.tk.call("set_theme", "dark")
|
||||
|
||||
# Load the image and convert it to a grayscale NumPy array
|
||||
input_image_path = "Resources/image.png"
|
||||
image = Image.open(input_image_path).convert("L")
|
||||
image_array = np.asarray(image, dtype=np.float32) / 255.0
|
||||
|
||||
# Original image display
|
||||
tk.Label(root, text="Source", font=("Arial", 14)).grid(row=0, column=0, padx=10, pady=10)
|
||||
original_image_resized = image.resize((image.width // 4, image.height // 4))
|
||||
original_image_tk = ImageTk.PhotoImage(original_image_resized)
|
||||
original_image_label = tk.Label(root, image=original_image_tk)
|
||||
original_image_label.grid(row=1, column=0, padx=10, pady=10)
|
||||
source_avg_gray_label = tk.Label(root, text="Average Gray Level: 0.00", font=("Arial", 12))
|
||||
source_avg_gray_label.grid(row=2, column=0)
|
||||
|
||||
# Processed image display
|
||||
tk.Label(root, text="Processed", font=("Arial", 14)).grid(row=0, column=1, padx=10, pady=10)
|
||||
processed_image = image
|
||||
processed_image_resized = processed_image.resize((processed_image.width // 4, processed_image.height // 4))
|
||||
processed_image_tk = ImageTk.PhotoImage(processed_image_resized)
|
||||
processed_image_label = tk.Label(root, image=processed_image_tk)
|
||||
processed_image_label.grid(row=1, column=1, padx=10, pady=10)
|
||||
processed_avg_gray_label = tk.Label(root, text="Average Gray Level: 0.00", font=("Arial", 12))
|
||||
processed_avg_gray_label.grid(row=2, column=1)
|
||||
|
||||
# Dark and light sliders
|
||||
Brighten_Shadows = tk.Label(root, text="Brighten Shadows")
|
||||
Brighten_Shadows.grid(row=3, column=0, pady=5, sticky="ew")
|
||||
|
||||
sensor_output1_slider = Scale(root, from_=0, to=255, orient="horizontal", label="Sensor Output 1", command=lambda x: update_image())
|
||||
sensor_output1_slider.set(64)
|
||||
sensor_output1_slider.grid(row=4, column=0, padx=10, pady=10)
|
||||
|
||||
mapped_output1_slider = Scale(root, from_=0, to=255, orient="horizontal", label="Mapped Output 1", command=lambda x: update_image())
|
||||
mapped_output1_slider.set(128)
|
||||
mapped_output1_slider.grid(row=5, column=0, padx=10, pady=10)
|
||||
|
||||
Darken_Bright = tk.Label(root, text="Darken Bright Areas")
|
||||
Darken_Bright.grid(row=3, column=1, pady=5, sticky="ew")
|
||||
|
||||
sensor_output2_slider = Scale(root, from_=0, to=255, orient="horizontal", label="Sensor Output 2", command=lambda x: update_image())
|
||||
sensor_output2_slider.set(192)
|
||||
sensor_output2_slider.grid(row=4, column=1, padx=10, pady=10)
|
||||
|
||||
mapped_output2_slider = Scale(root, from_=0, to=255, orient="horizontal", label="Mapped Output 2", command=lambda x: update_image())
|
||||
mapped_output2_slider.set(255)
|
||||
mapped_output2_slider.grid(row=5, column=1, padx=10, pady=10)
|
||||
|
||||
# Knee function graph
|
||||
figure_dark = Figure(figsize=(6, 4), dpi=100)
|
||||
knee_ax_dark = figure_dark.add_subplot(111)
|
||||
knee_canvas_dark = FigureCanvasTkAgg(figure_dark, root)
|
||||
knee_canvas_dark.get_tk_widget().grid(row=6, column=0, columnspan=2, padx=10, pady=10)
|
||||
|
||||
hendo_label = tk.Label(root, text="Made by Hendo 19/12/2024")
|
||||
hendo_label.grid(row=7, column=0, columnspan=2, pady=10, sticky="ew")
|
||||
|
||||
|
||||
# Run the GUI
|
||||
update_image()
|
||||
root.mainloop()
|
||||
@@ -0,0 +1,50 @@
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>4a05e730-1bdc-41c2-bcd1-fba1bdbd0c1e</ProjectGuid>
|
||||
<ProjectHome>.</ProjectHome>
|
||||
<StartupFile>Knees.py</StartupFile>
|
||||
<SearchPath>
|
||||
</SearchPath>
|
||||
<WorkingDirectory>.</WorkingDirectory>
|
||||
<OutputPath>.</OutputPath>
|
||||
<Name>Knees</Name>
|
||||
<RootNamespace>Knees</RootNamespace>
|
||||
<InterpreterId>MSBuild|env|$(MSBuildProjectFullPath)</InterpreterId>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Knees.py" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<InterpreterReference Include="Global|PythonCore|3.12" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Interpreter Include="env\">
|
||||
<Id>env</Id>
|
||||
<Version>3.13</Version>
|
||||
<Description>env (Python 3.13 (64-bit))</Description>
|
||||
<InterpreterPath>Scripts\python.exe</InterpreterPath>
|
||||
<WindowsInterpreterPath>Scripts\pythonw.exe</WindowsInterpreterPath>
|
||||
<PathEnvironmentVariable>PYTHONPATH</PathEnvironmentVariable>
|
||||
<Architecture>X64</Architecture>
|
||||
</Interpreter>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets" />
|
||||
<!-- Uncomment the CoreCompile target to enable the Build command in
|
||||
Visual Studio and specify your pre- and post-build commands in
|
||||
the BeforeBuild and AfterBuild targets below. -->
|
||||
<!--<Target Name="CoreCompile" />-->
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.12.35527.113 d17.12
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "Knees", "Knees.pyproj", "{4A05E730-1BDC-41C2-BCD1-FBA1BDBD0C1E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{4A05E730-1BDC-41C2-BCD1-FBA1BDBD0C1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4A05E730-1BDC-41C2-BCD1-FBA1BDBD0C1E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,87 @@
|
||||
# Copyright © 2021 rdbende <rdbende@gmail.com>
|
||||
|
||||
source [file join [file dirname [info script]] theme light.tcl]
|
||||
source [file join [file dirname [info script]] theme dark.tcl]
|
||||
|
||||
option add *tearOff 0
|
||||
|
||||
proc set_theme {mode} {
|
||||
if {$mode == "dark"} {
|
||||
ttk::style theme use "azure-dark"
|
||||
|
||||
array set colors {
|
||||
-fg "#ffffff"
|
||||
-bg "#333333"
|
||||
-disabledfg "#ffffff"
|
||||
-disabledbg "#737373"
|
||||
-selectfg "#ffffff"
|
||||
-selectbg "#007fff"
|
||||
}
|
||||
|
||||
ttk::style configure . \
|
||||
-background $colors(-bg) \
|
||||
-foreground $colors(-fg) \
|
||||
-troughcolor $colors(-bg) \
|
||||
-focuscolor $colors(-selectbg) \
|
||||
-selectbackground $colors(-selectbg) \
|
||||
-selectforeground $colors(-selectfg) \
|
||||
-insertcolor $colors(-fg) \
|
||||
-insertwidth 1 \
|
||||
-fieldbackground $colors(-selectbg) \
|
||||
-font {"Segoe Ui" 10} \
|
||||
-borderwidth 1 \
|
||||
-relief flat
|
||||
|
||||
tk_setPalette background [ttk::style lookup . -background] \
|
||||
foreground [ttk::style lookup . -foreground] \
|
||||
highlightColor [ttk::style lookup . -focuscolor] \
|
||||
selectBackground [ttk::style lookup . -selectbackground] \
|
||||
selectForeground [ttk::style lookup . -selectforeground] \
|
||||
activeBackground [ttk::style lookup . -selectbackground] \
|
||||
activeForeground [ttk::style lookup . -selectforeground]
|
||||
|
||||
ttk::style map . -foreground [list disabled $colors(-disabledfg)]
|
||||
|
||||
option add *font [ttk::style lookup . -font]
|
||||
option add *Menu.selectcolor $colors(-fg)
|
||||
|
||||
} elseif {$mode == "light"} {
|
||||
ttk::style theme use "azure-light"
|
||||
|
||||
array set colors {
|
||||
-fg "#000000"
|
||||
-bg "#ffffff"
|
||||
-disabledfg "#737373"
|
||||
-disabledbg "#ffffff"
|
||||
-selectfg "#ffffff"
|
||||
-selectbg "#007fff"
|
||||
}
|
||||
|
||||
ttk::style configure . \
|
||||
-background $colors(-bg) \
|
||||
-foreground $colors(-fg) \
|
||||
-troughcolor $colors(-bg) \
|
||||
-focuscolor $colors(-selectbg) \
|
||||
-selectbackground $colors(-selectbg) \
|
||||
-selectforeground $colors(-selectfg) \
|
||||
-insertcolor $colors(-fg) \
|
||||
-insertwidth 1 \
|
||||
-fieldbackground $colors(-selectbg) \
|
||||
-font {"Segoe Ui" 10} \
|
||||
-borderwidth 1 \
|
||||
-relief flat
|
||||
|
||||
tk_setPalette background [ttk::style lookup . -background] \
|
||||
foreground [ttk::style lookup . -foreground] \
|
||||
highlightColor [ttk::style lookup . -focuscolor] \
|
||||
selectBackground [ttk::style lookup . -selectbackground] \
|
||||
selectForeground [ttk::style lookup . -selectforeground] \
|
||||
activeBackground [ttk::style lookup . -selectbackground] \
|
||||
activeForeground [ttk::style lookup . -selectforeground]
|
||||
|
||||
ttk::style map . -foreground [list disabled $colors(-disabledfg)]
|
||||
|
||||
option add *font [ttk::style lookup . -font]
|
||||
option add *Menu.selectcolor $colors(-fg)
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 1.5 MiB |
@@ -0,0 +1,537 @@
|
||||
# Copyright (c) 2021 rdbende <rdbende@gmail.com>
|
||||
|
||||
# The Azure theme is a beautiful modern ttk theme inspired by Microsoft's fluent design.
|
||||
|
||||
package require Tk 8.6
|
||||
|
||||
namespace eval ttk::theme::azure-dark {
|
||||
variable version 2.0
|
||||
package provide ttk::theme::azure-dark $version
|
||||
|
||||
ttk::style theme create azure-dark -parent clam -settings {
|
||||
proc load_images {imgdir} {
|
||||
variable I
|
||||
foreach file [glob -directory $imgdir *.png] {
|
||||
set img [file tail [file rootname $file]]
|
||||
set I($img) [image create photo -file $file -format png]
|
||||
}
|
||||
}
|
||||
|
||||
load_images [file join [file dirname [info script]] dark]
|
||||
|
||||
array set colors {
|
||||
-fg "#ffffff"
|
||||
-bg "#333333"
|
||||
-disabledfg "#ffffff"
|
||||
-disabledbg "#737373"
|
||||
-selectfg "#ffffff"
|
||||
-selectbg "#007fff"
|
||||
}
|
||||
|
||||
ttk::style layout TButton {
|
||||
Button.button -children {
|
||||
Button.padding -children {
|
||||
Button.label -side left -expand true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout Toolbutton {
|
||||
Toolbutton.button -children {
|
||||
Toolbutton.padding -children {
|
||||
Toolbutton.label -side left -expand true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout TMenubutton {
|
||||
Menubutton.button -children {
|
||||
Menubutton.padding -children {
|
||||
Menubutton.indicator -side right
|
||||
Menubutton.label -side right -expand true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout TOptionMenu {
|
||||
OptionMenu.button -children {
|
||||
OptionMenu.padding -children {
|
||||
OptionMenu.indicator -side right
|
||||
OptionMenu.label -side right -expand true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout Accent.TButton {
|
||||
AccentButton.button -children {
|
||||
AccentButton.padding -children {
|
||||
AccentButton.label -side left -expand true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout TCheckbutton {
|
||||
Checkbutton.button -children {
|
||||
Checkbutton.padding -children {
|
||||
Checkbutton.indicator -side left
|
||||
Checkbutton.label -side right -expand true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout Switch.TCheckbutton {
|
||||
Switch.button -children {
|
||||
Switch.padding -children {
|
||||
Switch.indicator -side left
|
||||
Switch.label -side right -expand true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout Toggle.TButton {
|
||||
ToggleButton.button -children {
|
||||
ToggleButton.padding -children {
|
||||
ToggleButton.label -side left -expand true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout TRadiobutton {
|
||||
Radiobutton.button -children {
|
||||
Radiobutton.padding -children {
|
||||
Radiobutton.indicator -side left
|
||||
Radiobutton.label -side right -expand true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout Vertical.TScrollbar {
|
||||
Vertical.Scrollbar.trough -sticky ns -children {
|
||||
Vertical.Scrollbar.thumb -expand true
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout Horizontal.TScrollbar {
|
||||
Horizontal.Scrollbar.trough -sticky ew -children {
|
||||
Horizontal.Scrollbar.thumb -expand true
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout TCombobox {
|
||||
Combobox.field -sticky nswe -children {
|
||||
Combobox.padding -expand true -sticky nswe -children {
|
||||
Combobox.textarea -sticky nswe
|
||||
}
|
||||
}
|
||||
Combobox.button -side right -sticky ns -children {
|
||||
Combobox.arrow -sticky nsew
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout TSpinbox {
|
||||
Spinbox.field -sticky nsew -children {
|
||||
Spinbox.padding -expand true -sticky nswe -children {
|
||||
Spinbox.textarea -sticky nswe
|
||||
}
|
||||
|
||||
}
|
||||
Spinbox.button -side right -sticky ns -children {
|
||||
null -side right -children {
|
||||
Spinbox.uparrow -side top
|
||||
Spinbox.downarrow -side bottom
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout Horizontal.TSeparator {
|
||||
Horizontal.separator -sticky nswe
|
||||
}
|
||||
|
||||
ttk::style layout Vertical.TSeparator {
|
||||
Vertical.separator -sticky nswe
|
||||
}
|
||||
|
||||
ttk::style layout Horizontal.Tick.TScale {
|
||||
Horizontal.TickScale.trough -sticky ew -children {
|
||||
Horizontal.TickScale.slider -sticky w
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout Vertical.Tick.TScale {
|
||||
Vertical.TickScale.trough -sticky ns -children {
|
||||
Vertical.TickScale.slider -sticky n
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout Card.TFrame {
|
||||
Card.field {
|
||||
Card.padding -expand 1
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout TLabelframe {
|
||||
Labelframe.border {
|
||||
Labelframe.padding -expand 1 -children {
|
||||
Labelframe.label -side right
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout TNotebook.Tab {
|
||||
Notebook.tab -children {
|
||||
Notebook.padding -side top -children {
|
||||
Notebook.label -side top -sticky {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout Treeview.Item {
|
||||
Treeitem.padding -sticky nswe -children {
|
||||
Treeitem.indicator -side left -sticky {}
|
||||
Treeitem.image -side left -sticky {}
|
||||
Treeitem.text -side left -sticky {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Elements
|
||||
|
||||
# Button
|
||||
ttk::style configure TButton -padding {8 4 8 4} -width -10 -anchor center
|
||||
|
||||
ttk::style element create Button.button image \
|
||||
[list $I(rect-basic) \
|
||||
{selected disabled} $I(rect-basic) \
|
||||
disabled $I(rect-basic) \
|
||||
pressed $I(rect-basic) \
|
||||
selected $I(rect-basic) \
|
||||
active $I(button-hover) \
|
||||
] -border 4 -sticky ewns
|
||||
|
||||
# Toolbutton
|
||||
ttk::style configure Toolbutton -padding {8 4 8 4} -width -10 -anchor center
|
||||
|
||||
ttk::style element create Toolbutton.button image \
|
||||
[list $I(empty) \
|
||||
{selected disabled} $I(empty) \
|
||||
disabled $I(empty) \
|
||||
pressed $I(rect-basic) \
|
||||
selected $I(rect-basic) \
|
||||
active $I(rect-basic) \
|
||||
] -border 4 -sticky ewns
|
||||
|
||||
# Menubutton
|
||||
ttk::style configure TMenubutton -padding {8 4 4 4}
|
||||
|
||||
ttk::style element create Menubutton.button \
|
||||
image [list $I(rect-basic) \
|
||||
disabled $I(rect-basic) \
|
||||
pressed $I(rect-basic) \
|
||||
active $I(button-hover) \
|
||||
] -border 4 -sticky ewns
|
||||
|
||||
ttk::style element create Menubutton.indicator \
|
||||
image [list $I(down) \
|
||||
active $I(down) \
|
||||
pressed $I(down) \
|
||||
disabled $I(down) \
|
||||
] -width 15 -sticky e
|
||||
|
||||
# OptionMenu
|
||||
ttk::style configure TOptionMenu -padding {8 4 4 4}
|
||||
|
||||
ttk::style element create OptionMenu.button \
|
||||
image [list $I(rect-basic) \
|
||||
disabled $I(rect-basic) \
|
||||
pressed $I(rect-basic) \
|
||||
active $I(button-hover) \
|
||||
] -border 4 -sticky ewns
|
||||
|
||||
ttk::style element create OptionMenu.indicator \
|
||||
image [list $I(down) \
|
||||
active $I(down) \
|
||||
pressed $I(down) \
|
||||
disabled $I(down) \
|
||||
] -width 15 -sticky e
|
||||
|
||||
# AccentButton
|
||||
ttk::style configure Accent.TButton -padding {8 4 8 4} -width -10 -anchor center
|
||||
|
||||
ttk::style element create AccentButton.button image \
|
||||
[list $I(rect-accent) \
|
||||
{selected disabled} $I(rect-accent-hover) \
|
||||
disabled $I(rect-accent-hover) \
|
||||
pressed $I(rect-accent) \
|
||||
selected $I(rect-accent) \
|
||||
active $I(rect-accent-hover) \
|
||||
] -border 4 -sticky ewns
|
||||
|
||||
# Checkbutton
|
||||
ttk::style configure TCheckbutton -padding 4
|
||||
|
||||
ttk::style element create Checkbutton.indicator image \
|
||||
[list $I(box-basic) \
|
||||
{alternate disabled} $I(check-tri-basic) \
|
||||
{selected disabled} $I(check-basic) \
|
||||
disabled $I(box-basic) \
|
||||
{pressed alternate} $I(check-tri-hover) \
|
||||
{active alternate} $I(check-tri-hover) \
|
||||
alternate $I(check-tri-accent) \
|
||||
{pressed selected} $I(check-hover) \
|
||||
{active selected} $I(check-hover) \
|
||||
selected $I(check-accent) \
|
||||
{pressed !selected} $I(rect-hover) \
|
||||
active $I(box-hover) \
|
||||
] -width 26 -sticky w
|
||||
|
||||
# Switch
|
||||
ttk::style element create Switch.indicator image \
|
||||
[list $I(off-basic) \
|
||||
{selected disabled} $I(on-basic) \
|
||||
disabled $I(off-basic) \
|
||||
{pressed selected} $I(on-accent) \
|
||||
{active selected} $I(on-accent) \
|
||||
selected $I(on-accent) \
|
||||
{pressed !selected} $I(off-basic) \
|
||||
active $I(off-basic) \
|
||||
] -width 46 -sticky w
|
||||
|
||||
# ToggleButton
|
||||
ttk::style configure Toggle.TButton -padding {8 4 8 4} -width -10 -anchor center
|
||||
|
||||
ttk::style element create ToggleButton.button image \
|
||||
[list $I(rect-basic) \
|
||||
{selected disabled} $I(rect-accent-hover) \
|
||||
disabled $I(rect-basic) \
|
||||
{pressed selected} $I(rect-basic) \
|
||||
{active selected} $I(rect-accent) \
|
||||
selected $I(rect-accent) \
|
||||
{pressed !selected} $I(rect-accent) \
|
||||
active $I(rect-basic) \
|
||||
] -border 4 -sticky ewns
|
||||
|
||||
# Radiobutton
|
||||
ttk::style configure TRadiobutton -padding 4
|
||||
|
||||
ttk::style element create Radiobutton.indicator image \
|
||||
[list $I(outline-basic) \
|
||||
{alternate disabled} $I(radio-tri-basic) \
|
||||
{selected disabled} $I(radio-basic) \
|
||||
disabled $I(outline-basic) \
|
||||
{pressed alternate} $I(radio-tri-hover) \
|
||||
{active alternate} $I(radio-tri-hover) \
|
||||
alternate $I(radio-tri-accent) \
|
||||
{pressed selected} $I(radio-hover) \
|
||||
{active selected} $I(radio-hover) \
|
||||
selected $I(radio-accent) \
|
||||
{pressed !selected} $I(circle-hover) \
|
||||
active $I(outline-hover) \
|
||||
] -width 26 -sticky w
|
||||
|
||||
# Scrollbar
|
||||
ttk::style element create Horizontal.Scrollbar.trough image $I(hor-basic) \
|
||||
-sticky ew
|
||||
|
||||
ttk::style element create Horizontal.Scrollbar.thumb \
|
||||
image [list $I(hor-accent) \
|
||||
disabled $I(hor-basic) \
|
||||
pressed $I(hor-hover) \
|
||||
active $I(hor-hover) \
|
||||
] -sticky ew
|
||||
|
||||
ttk::style element create Vertical.Scrollbar.trough image $I(vert-basic) \
|
||||
-sticky ns
|
||||
|
||||
ttk::style element create Vertical.Scrollbar.thumb \
|
||||
image [list $I(vert-accent) \
|
||||
disabled $I(vert-basic) \
|
||||
pressed $I(vert-hover) \
|
||||
active $I(vert-hover) \
|
||||
] -sticky ns
|
||||
|
||||
# Scale
|
||||
ttk::style element create Horizontal.Scale.trough image $I(scale-hor) \
|
||||
-border 5 -padding 0
|
||||
|
||||
ttk::style element create Horizontal.Scale.slider \
|
||||
image [list $I(circle-accent) \
|
||||
disabled $I(circle-basic) \
|
||||
pressed $I(circle-hover) \
|
||||
active $I(circle-hover) \
|
||||
] -sticky {}
|
||||
|
||||
ttk::style element create Vertical.Scale.trough image $I(scale-vert) \
|
||||
-border 5 -padding 0
|
||||
|
||||
ttk::style element create Vertical.Scale.slider \
|
||||
image [list $I(circle-accent) \
|
||||
disabled $I(circle-basic) \
|
||||
pressed $I(circle-hover) \
|
||||
active $I(circle-hover) \
|
||||
] -sticky {}
|
||||
|
||||
# Tickscale
|
||||
ttk::style element create Horizontal.TickScale.trough image $I(scale-hor) \
|
||||
-border 5 -padding 0
|
||||
|
||||
ttk::style element create Horizontal.TickScale.slider \
|
||||
image [list $I(tick-hor-accent) \
|
||||
disabled $I(tick-hor-basic) \
|
||||
pressed $I(tick-hor-hover) \
|
||||
active $I(tick-hor-hover) \
|
||||
] -sticky {}
|
||||
|
||||
ttk::style element create Vertical.TickScale.trough image $I(scale-vert) \
|
||||
-border 5 -padding 0
|
||||
|
||||
ttk::style element create Vertical.TickScale.slider \
|
||||
image [list $I(tick-vert-accent) \
|
||||
disabled $I(tick-vert-basic) \
|
||||
pressed $I(tick-vert-hover) \
|
||||
active $I(tick-vert-hover) \
|
||||
] -sticky {}
|
||||
|
||||
# Progressbar
|
||||
ttk::style element create Horizontal.Progressbar.trough image $I(hor-basic) \
|
||||
-sticky ew
|
||||
|
||||
ttk::style element create Horizontal.Progressbar.pbar image $I(hor-accent) \
|
||||
-sticky ew
|
||||
|
||||
ttk::style element create Vertical.Progressbar.trough image $I(vert-basic) \
|
||||
-sticky ns
|
||||
|
||||
ttk::style element create Vertical.Progressbar.pbar image $I(vert-accent) \
|
||||
-sticky ns
|
||||
|
||||
# Entry
|
||||
ttk::style element create Entry.field \
|
||||
image [list $I(box-basic) \
|
||||
{focus hover} $I(box-accent) \
|
||||
invalid $I(box-invalid) \
|
||||
disabled $I(box-basic) \
|
||||
focus $I(box-accent) \
|
||||
hover $I(box-hover) \
|
||||
] -border 5 -padding {8} -sticky news
|
||||
|
||||
# Combobox
|
||||
ttk::style map TCombobox -selectbackground [list \
|
||||
{!focus} $colors(-selectbg) \
|
||||
{readonly hover} $colors(-selectbg) \
|
||||
{readonly focus} $colors(-selectbg) \
|
||||
]
|
||||
|
||||
ttk::style map TCombobox -selectforeground [list \
|
||||
{!focus} $colors(-selectfg) \
|
||||
{readonly hover} $colors(-selectfg) \
|
||||
{readonly focus} $colors(-selectfg) \
|
||||
]
|
||||
|
||||
ttk::style element create Combobox.field \
|
||||
image [list $I(box-basic) \
|
||||
{readonly disabled} $I(rect-basic) \
|
||||
{readonly pressed} $I(rect-basic) \
|
||||
{readonly focus hover} $I(button-hover) \
|
||||
{readonly focus} $I(button-hover) \
|
||||
{readonly hover} $I(button-hover) \
|
||||
{focus hover} $I(box-accent) \
|
||||
readonly $I(rect-basic) \
|
||||
invalid $I(box-invalid) \
|
||||
disabled $I(box-basic) \
|
||||
focus $I(box-accent) \
|
||||
hover $I(box-hover) \
|
||||
] -border 5 -padding {8}
|
||||
|
||||
ttk::style element create Combobox.button \
|
||||
image [list $I(combo-button-basic) \
|
||||
{!readonly focus} $I(combo-button-focus) \
|
||||
{readonly focus} $I(combo-button-hover) \
|
||||
{readonly hover} $I(combo-button-hover)
|
||||
] -border 5 -padding {2 6 6 6}
|
||||
|
||||
ttk::style element create Combobox.arrow image $I(down) \
|
||||
-width 15 -sticky e
|
||||
|
||||
# Spinbox
|
||||
ttk::style element create Spinbox.field \
|
||||
image [list $I(box-basic) \
|
||||
invalid $I(box-invalid) \
|
||||
disabled $I(box-basic) \
|
||||
focus $I(box-accent) \
|
||||
hover $I(box-hover) \
|
||||
] -border 5 -padding {8} -sticky news
|
||||
|
||||
ttk::style element create Spinbox.uparrow \
|
||||
image [list $I(up) \
|
||||
disabled $I(up) \
|
||||
pressed $I(up-accent) \
|
||||
active $I(up-accent) \
|
||||
] -border 4 -width 15 -sticky e
|
||||
|
||||
ttk::style element create Spinbox.downarrow \
|
||||
image [list $I(down) \
|
||||
disabled $I(down) \
|
||||
pressed $I(down-accent) \
|
||||
active $I(down-accent) \
|
||||
] -border 4 -width 15 -sticky e
|
||||
|
||||
ttk::style element create Spinbox.button \
|
||||
image [list $I(combo-button-basic) \
|
||||
{!readonly focus} $I(combo-button-focus) \
|
||||
{readonly focus} $I(combo-button-hover) \
|
||||
{readonly hover} $I(combo-button-hover)
|
||||
] -border 5 -padding {2 6 6 6}
|
||||
|
||||
# Sizegrip
|
||||
ttk::style element create Sizegrip.sizegrip image $I(size) \
|
||||
-sticky ewns
|
||||
|
||||
# Separator
|
||||
ttk::style element create Horizontal.separator image $I(separator)
|
||||
|
||||
ttk::style element create Vertical.separator image $I(separator)
|
||||
|
||||
# Card
|
||||
ttk::style element create Card.field image $I(card) \
|
||||
-border 10 -padding 4 -sticky news
|
||||
|
||||
# Labelframe
|
||||
ttk::style element create Labelframe.border image $I(card) \
|
||||
-border 5 -padding 4 -sticky news
|
||||
|
||||
# Notebook
|
||||
ttk::style element create Notebook.client \
|
||||
image $I(notebook) -border 5
|
||||
|
||||
ttk::style element create Notebook.tab \
|
||||
image [list $I(tab-disabled) \
|
||||
selected $I(tab-basic) \
|
||||
active $I(tab-hover) \
|
||||
] -border 5 -padding {14 4}
|
||||
|
||||
# Treeview
|
||||
ttk::style element create Treeview.field image $I(card) \
|
||||
-border 5
|
||||
|
||||
ttk::style element create Treeheading.cell \
|
||||
image [list $I(tree-basic) \
|
||||
pressed $I(tree-pressed)
|
||||
] -border 5 -padding 4 -sticky ewns
|
||||
|
||||
ttk::style element create Treeitem.indicator \
|
||||
image [list $I(right) \
|
||||
user2 $I(empty) \
|
||||
user1 $I(down) \
|
||||
] -width 26 -sticky {}
|
||||
|
||||
ttk::style configure Treeview -background $colors(-bg)
|
||||
ttk::style configure Treeview.Item -padding {2 0 0 0}
|
||||
ttk::style map Treeview \
|
||||
-background [list selected $colors(-selectbg)] \
|
||||
-foreground [list selected $colors(-selectfg)]
|
||||
|
||||
# Panedwindow
|
||||
# Insane hack to remove clam's ugly sash
|
||||
ttk::style configure Sash -gripcount 0
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 424 B |
|
After Width: | Height: | Size: 330 B |
|
After Width: | Height: | Size: 357 B |
|
After Width: | Height: | Size: 405 B |
|
After Width: | Height: | Size: 346 B |
|
After Width: | Height: | Size: 457 B |
|
After Width: | Height: | Size: 482 B |
|
After Width: | Height: | Size: 423 B |
|
After Width: | Height: | Size: 453 B |
|
After Width: | Height: | Size: 346 B |
|
After Width: | Height: | Size: 310 B |
|
After Width: | Height: | Size: 326 B |
|
After Width: | Height: | Size: 484 B |
|
After Width: | Height: | Size: 437 B |
|
After Width: | Height: | Size: 470 B |
|
After Width: | Height: | Size: 242 B |
|
After Width: | Height: | Size: 248 B |
|
After Width: | Height: | Size: 297 B |
|
After Width: | Height: | Size: 234 B |
|
After Width: | Height: | Size: 261 B |
|
After Width: | Height: | Size: 130 B |
|
After Width: | Height: | Size: 154 B |
|
After Width: | Height: | Size: 156 B |
|
After Width: | Height: | Size: 154 B |
|
After Width: | Height: | Size: 410 B |
|
After Width: | Height: | Size: 677 B |
|
After Width: | Height: | Size: 736 B |
|
After Width: | Height: | Size: 668 B |
|
After Width: | Height: | Size: 587 B |
|
After Width: | Height: | Size: 644 B |
|
After Width: | Height: | Size: 629 B |
|
After Width: | Height: | Size: 561 B |
|
After Width: | Height: | Size: 625 B |
|
After Width: | Height: | Size: 524 B |
|
After Width: | Height: | Size: 505 B |
|
After Width: | Height: | Size: 466 B |
|
After Width: | Height: | Size: 289 B |
|
After Width: | Height: | Size: 319 B |
|
After Width: | Height: | Size: 286 B |
|
After Width: | Height: | Size: 297 B |
|
After Width: | Height: | Size: 255 B |
|
After Width: | Height: | Size: 161 B |
|
After Width: | Height: | Size: 161 B |
|
After Width: | Height: | Size: 128 B |
|
After Width: | Height: | Size: 477 B |
|
After Width: | Height: | Size: 249 B |
|
After Width: | Height: | Size: 234 B |
|
After Width: | Height: | Size: 260 B |
|
After Width: | Height: | Size: 302 B |
|
After Width: | Height: | Size: 267 B |
|
After Width: | Height: | Size: 280 B |
|
After Width: | Height: | Size: 295 B |
|
After Width: | Height: | Size: 257 B |
|
After Width: | Height: | Size: 277 B |
|
After Width: | Height: | Size: 149 B |
|
After Width: | Height: | Size: 168 B |
|
After Width: | Height: | Size: 242 B |
|
After Width: | Height: | Size: 271 B |
|
After Width: | Height: | Size: 158 B |
|
After Width: | Height: | Size: 158 B |
|
After Width: | Height: | Size: 158 B |
@@ -0,0 +1,537 @@
|
||||
# Copyright (c) 2021 rdbende <rdbende@gmail.com>
|
||||
|
||||
# The Azure theme is a beautiful modern ttk theme inspired by Microsoft's fluent design.
|
||||
|
||||
package require Tk 8.6
|
||||
|
||||
namespace eval ttk::theme::azure-light {
|
||||
variable version 2.0
|
||||
package provide ttk::theme::azure-light $version
|
||||
|
||||
ttk::style theme create azure-light -parent clam -settings {
|
||||
proc load_images {imgdir} {
|
||||
variable I
|
||||
foreach file [glob -directory $imgdir *.png] {
|
||||
set img [file tail [file rootname $file]]
|
||||
set I($img) [image create photo -file $file -format png]
|
||||
}
|
||||
}
|
||||
|
||||
load_images [file join [file dirname [info script]] light]
|
||||
|
||||
array set colors {
|
||||
-fg "#000000"
|
||||
-bg "#ffffff"
|
||||
-disabledfg "#737373"
|
||||
-disabledbg "#ffffff"
|
||||
-selectfg "#ffffff"
|
||||
-selectbg "#007fff"
|
||||
}
|
||||
|
||||
ttk::style layout TButton {
|
||||
Button.button -children {
|
||||
Button.padding -children {
|
||||
Button.label -side left -expand true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout Toolbutton {
|
||||
Toolbutton.button -children {
|
||||
Toolbutton.padding -children {
|
||||
Toolbutton.label -side left -expand true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout TMenubutton {
|
||||
Menubutton.button -children {
|
||||
Menubutton.padding -children {
|
||||
Menubutton.indicator -side right
|
||||
Menubutton.label -side right -expand true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout TOptionMenu {
|
||||
OptionMenu.button -children {
|
||||
OptionMenu.padding -children {
|
||||
OptionMenu.indicator -side right
|
||||
OptionMenu.label -side right -expand true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout Accent.TButton {
|
||||
AccentButton.button -children {
|
||||
AccentButton.padding -children {
|
||||
AccentButton.label -side left -expand true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout TCheckbutton {
|
||||
Checkbutton.button -children {
|
||||
Checkbutton.padding -children {
|
||||
Checkbutton.indicator -side left
|
||||
Checkbutton.label -side right -expand true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout Switch.TCheckbutton {
|
||||
Switch.button -children {
|
||||
Switch.padding -children {
|
||||
Switch.indicator -side left
|
||||
Switch.label -side right -expand true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout Toggle.TButton {
|
||||
ToggleButton.button -children {
|
||||
ToggleButton.padding -children {
|
||||
ToggleButton.label -side left -expand true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout TRadiobutton {
|
||||
Radiobutton.button -children {
|
||||
Radiobutton.padding -children {
|
||||
Radiobutton.indicator -side left
|
||||
Radiobutton.label -side right -expand true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout Vertical.TScrollbar {
|
||||
Vertical.Scrollbar.trough -sticky ns -children {
|
||||
Vertical.Scrollbar.thumb -expand true
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout Horizontal.TScrollbar {
|
||||
Horizontal.Scrollbar.trough -sticky ew -children {
|
||||
Horizontal.Scrollbar.thumb -expand true
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout TCombobox {
|
||||
Combobox.field -sticky nswe -children {
|
||||
Combobox.padding -expand true -sticky nswe -children {
|
||||
Combobox.textarea -sticky nswe
|
||||
}
|
||||
}
|
||||
Combobox.button -side right -sticky ns -children {
|
||||
Combobox.arrow -sticky nsew
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout TSpinbox {
|
||||
Spinbox.field -sticky nsew -children {
|
||||
Spinbox.padding -expand true -sticky nswe -children {
|
||||
Spinbox.textarea -sticky nswe
|
||||
}
|
||||
|
||||
}
|
||||
Spinbox.button -side right -sticky ns -children {
|
||||
null -side right -children {
|
||||
Spinbox.uparrow -side top
|
||||
Spinbox.downarrow -side bottom
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout Horizontal.TSeparator {
|
||||
Horizontal.separator -sticky nswe
|
||||
}
|
||||
|
||||
ttk::style layout Vertical.TSeparator {
|
||||
Vertical.separator -sticky nswe
|
||||
}
|
||||
|
||||
ttk::style layout Horizontal.Tick.TScale {
|
||||
Horizontal.TickScale.trough -sticky ew -children {
|
||||
Horizontal.TickScale.slider -sticky w
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout Vertical.Tick.TScale {
|
||||
Vertical.TickScale.trough -sticky ns -children {
|
||||
Vertical.TickScale.slider -sticky n
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout Card.TFrame {
|
||||
Card.field {
|
||||
Card.padding -expand 1
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout TLabelframe {
|
||||
Labelframe.border {
|
||||
Labelframe.padding -expand 1 -children {
|
||||
Labelframe.label -side right
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout TNotebook.Tab {
|
||||
Notebook.tab -children {
|
||||
Notebook.padding -side top -children {
|
||||
Notebook.label -side top -sticky {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ttk::style layout Treeview.Item {
|
||||
Treeitem.padding -sticky nswe -children {
|
||||
Treeitem.indicator -side left -sticky {}
|
||||
Treeitem.image -side left -sticky {}
|
||||
Treeitem.text -side left -sticky {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Elements
|
||||
|
||||
# Button
|
||||
ttk::style configure TButton -padding {8 4 8 4} -width -10 -anchor center
|
||||
|
||||
ttk::style element create Button.button image \
|
||||
[list $I(rect-basic) \
|
||||
{selected disabled} $I(rect-basic) \
|
||||
disabled $I(rect-basic) \
|
||||
selected $I(rect-basic) \
|
||||
pressed $I(rect-basic) \
|
||||
active $I(button-hover) \
|
||||
] -border 4 -sticky ewns
|
||||
|
||||
# Toolbutton
|
||||
ttk::style configure Toolbutton -padding {8 4 8 4} -width -10 -anchor center
|
||||
|
||||
ttk::style element create Toolbutton.button image \
|
||||
[list $I(empty) \
|
||||
{selected disabled} $I(empty) \
|
||||
disabled $I(empty) \
|
||||
selected $I(rect-basic) \
|
||||
pressed $I(rect-basic) \
|
||||
active $I(rect-basic) \
|
||||
] -border 4 -sticky ewns
|
||||
|
||||
# Menubutton
|
||||
ttk::style configure TMenubutton -padding {8 4 4 4}
|
||||
|
||||
ttk::style element create Menubutton.button \
|
||||
image [list $I(rect-basic) \
|
||||
disabled $I(rect-basic) \
|
||||
pressed $I(rect-basic) \
|
||||
active $I(button-hover) \
|
||||
] -border 4 -sticky ewns
|
||||
|
||||
ttk::style element create Menubutton.indicator \
|
||||
image [list $I(down) \
|
||||
active $I(down) \
|
||||
pressed $I(down) \
|
||||
disabled $I(down) \
|
||||
] -width 15 -sticky e
|
||||
|
||||
# OptionMenu
|
||||
ttk::style configure TOptionMenu -padding {8 4 4 4}
|
||||
|
||||
ttk::style element create OptionMenu.button \
|
||||
image [list $I(rect-basic) \
|
||||
disabled $I(rect-basic) \
|
||||
pressed $I(rect-basic) \
|
||||
active $I(button-hover) \
|
||||
] -border 4 -sticky ewns
|
||||
|
||||
ttk::style element create OptionMenu.indicator \
|
||||
image [list $I(down) \
|
||||
active $I(down) \
|
||||
pressed $I(down) \
|
||||
disabled $I(down) \
|
||||
] -width 15 -sticky e
|
||||
|
||||
# AccentButton
|
||||
ttk::style configure Accent.TButton -padding {8 4 8 4} -width -10 -anchor center
|
||||
|
||||
ttk::style element create AccentButton.button image \
|
||||
[list $I(rect-accent) \
|
||||
{selected disabled} $I(rect-accent-hover) \
|
||||
disabled $I(rect-accent-hover) \
|
||||
selected $I(rect-accent) \
|
||||
pressed $I(rect-accent) \
|
||||
active $I(rect-accent-hover) \
|
||||
] -border 4 -sticky ewns
|
||||
|
||||
# Checkbutton
|
||||
ttk::style configure TCheckbutton -padding 4
|
||||
|
||||
ttk::style element create Checkbutton.indicator image \
|
||||
[list $I(box-basic) \
|
||||
{alternate disabled} $I(check-tri-basic) \
|
||||
{selected disabled} $I(check-basic) \
|
||||
disabled $I(box-basic) \
|
||||
{pressed alternate} $I(check-tri-hover) \
|
||||
{active alternate} $I(check-tri-hover) \
|
||||
alternate $I(check-tri-accent) \
|
||||
{pressed selected} $I(check-hover) \
|
||||
{active selected} $I(check-hover) \
|
||||
selected $I(check-accent) \
|
||||
{pressed !selected} $I(rect-hover) \
|
||||
active $I(box-hover) \
|
||||
] -width 26 -sticky w
|
||||
|
||||
# Switch
|
||||
ttk::style element create Switch.indicator image \
|
||||
[list $I(off-basic) \
|
||||
{selected disabled} $I(on-basic) \
|
||||
disabled $I(off-basic) \
|
||||
{pressed selected} $I(on-hover) \
|
||||
{active selected} $I(on-hover) \
|
||||
selected $I(on-accent) \
|
||||
{pressed !selected} $I(off-hover) \
|
||||
active $I(off-hover) \
|
||||
] -width 46 -sticky w
|
||||
|
||||
# ToggleButton
|
||||
ttk::style configure Toggle.TButton -padding {8 4 8 4} -width -10 -anchor center
|
||||
|
||||
ttk::style element create ToggleButton.button image \
|
||||
[list $I(rect-basic) \
|
||||
{selected disabled} $I(rect-accent-hover) \
|
||||
disabled $I(rect-basic) \
|
||||
{pressed selected} $I(rect-basic) \
|
||||
{active selected} $I(rect-accent) \
|
||||
selected $I(rect-accent) \
|
||||
{pressed !selected} $I(rect-accent) \
|
||||
active $I(rect-basic) \
|
||||
] -border 4 -sticky ewns
|
||||
|
||||
# Radiobutton
|
||||
ttk::style configure TRadiobutton -padding 4
|
||||
|
||||
ttk::style element create Radiobutton.indicator image \
|
||||
[list $I(outline-basic) \
|
||||
{alternate disabled} $I(radio-tri-basic) \
|
||||
{selected disabled} $I(radio-basic) \
|
||||
disabled $I(outline-basic) \
|
||||
{pressed alternate} $I(radio-tri-hover) \
|
||||
{active alternate} $I(radio-tri-hover) \
|
||||
alternate $I(radio-tri-accent) \
|
||||
{pressed selected} $I(radio-hover) \
|
||||
{active selected} $I(radio-hover) \
|
||||
selected $I(radio-accent) \
|
||||
{pressed !selected} $I(circle-hover) \
|
||||
active $I(outline-hover) \
|
||||
] -width 26 -sticky w
|
||||
|
||||
# Scrollbar
|
||||
ttk::style element create Horizontal.Scrollbar.trough image $I(hor-basic) \
|
||||
-sticky ew
|
||||
|
||||
ttk::style element create Horizontal.Scrollbar.thumb \
|
||||
image [list $I(hor-accent) \
|
||||
disabled $I(hor-basic) \
|
||||
pressed $I(hor-hover) \
|
||||
active $I(hor-hover) \
|
||||
] -sticky ew
|
||||
|
||||
ttk::style element create Vertical.Scrollbar.trough image $I(vert-basic) \
|
||||
-sticky ns
|
||||
|
||||
ttk::style element create Vertical.Scrollbar.thumb \
|
||||
image [list $I(vert-accent) \
|
||||
disabled $I(vert-basic) \
|
||||
pressed $I(vert-hover) \
|
||||
active $I(vert-hover) \
|
||||
] -sticky ns
|
||||
|
||||
# Scale
|
||||
ttk::style element create Horizontal.Scale.trough image $I(scale-hor) \
|
||||
-border 5 -padding 0
|
||||
|
||||
ttk::style element create Horizontal.Scale.slider \
|
||||
image [list $I(circle-accent) \
|
||||
disabled $I(circle-basic) \
|
||||
pressed $I(circle-hover) \
|
||||
active $I(circle-hover) \
|
||||
] -sticky {}
|
||||
|
||||
ttk::style element create Vertical.Scale.trough image $I(scale-vert) \
|
||||
-border 5 -padding 0
|
||||
|
||||
ttk::style element create Vertical.Scale.slider \
|
||||
image [list $I(circle-accent) \
|
||||
disabled $I(circle-basic) \
|
||||
pressed $I(circle-hover) \
|
||||
active $I(circle-hover) \
|
||||
] -sticky {}
|
||||
|
||||
# Tickscale
|
||||
ttk::style element create Horizontal.TickScale.trough image $I(scale-hor) \
|
||||
-border 5 -padding 0
|
||||
|
||||
ttk::style element create Horizontal.TickScale.slider \
|
||||
image [list $I(tick-hor-accent) \
|
||||
disabled $I(tick-hor-basic) \
|
||||
pressed $I(tick-hor-hover) \
|
||||
active $I(tick-hor-hover) \
|
||||
] -sticky {}
|
||||
|
||||
ttk::style element create Vertical.TickScale.trough image $I(scale-vert) \
|
||||
-border 5 -padding 0
|
||||
|
||||
ttk::style element create Vertical.TickScale.slider \
|
||||
image [list $I(tick-vert-accent) \
|
||||
disabled $I(tick-vert-basic) \
|
||||
pressed $I(tick-vert-hover) \
|
||||
active $I(tick-vert-hover) \
|
||||
] -sticky {}
|
||||
|
||||
# Progressbar
|
||||
ttk::style element create Horizontal.Progressbar.trough image $I(hor-basic) \
|
||||
-sticky ew
|
||||
|
||||
ttk::style element create Horizontal.Progressbar.pbar image $I(hor-accent) \
|
||||
-sticky ew
|
||||
|
||||
ttk::style element create Vertical.Progressbar.trough image $I(vert-basic) \
|
||||
-sticky ns
|
||||
|
||||
ttk::style element create Vertical.Progressbar.pbar image $I(vert-accent) \
|
||||
-sticky ns
|
||||
|
||||
# Entry
|
||||
ttk::style element create Entry.field \
|
||||
image [list $I(box-basic) \
|
||||
{focus hover} $I(box-accent) \
|
||||
invalid $I(box-invalid) \
|
||||
disabled $I(box-basic) \
|
||||
focus $I(box-accent) \
|
||||
hover $I(box-hover) \
|
||||
] -border 5 -padding {8} -sticky news
|
||||
|
||||
# Combobox
|
||||
ttk::style map TCombobox -selectbackground [list \
|
||||
{!focus} $colors(-selectbg) \
|
||||
{readonly hover} $colors(-selectbg) \
|
||||
{readonly focus} $colors(-selectbg) \
|
||||
]
|
||||
|
||||
ttk::style map TCombobox -selectforeground [list \
|
||||
{!focus} $colors(-selectfg) \
|
||||
{readonly hover} $colors(-selectfg) \
|
||||
{readonly focus} $colors(-selectfg) \
|
||||
]
|
||||
|
||||
ttk::style element create Combobox.field \
|
||||
image [list $I(box-basic) \
|
||||
{readonly disabled} $I(rect-basic) \
|
||||
{readonly pressed} $I(rect-basic) \
|
||||
{readonly focus hover} $I(button-hover) \
|
||||
{readonly focus} $I(button-hover) \
|
||||
{readonly hover} $I(button-hover) \
|
||||
{focus hover} $I(box-accent) \
|
||||
readonly $I(rect-basic) \
|
||||
invalid $I(box-invalid) \
|
||||
disabled $I(box-basic) \
|
||||
focus $I(box-accent) \
|
||||
hover $I(box-hover) \
|
||||
] -border 5 -padding {8}
|
||||
|
||||
ttk::style element create Combobox.button \
|
||||
image [list $I(combo-button-basic) \
|
||||
{!readonly focus} $I(combo-button-focus) \
|
||||
{readonly focus} $I(combo-button-hover) \
|
||||
{readonly hover} $I(combo-button-hover)
|
||||
] -border 5 -padding {2 6 6 6}
|
||||
|
||||
ttk::style element create Combobox.arrow image $I(down) \
|
||||
-width 15 -sticky e
|
||||
|
||||
# Spinbox
|
||||
ttk::style element create Spinbox.field \
|
||||
image [list $I(box-basic) \
|
||||
invalid $I(box-invalid) \
|
||||
disabled $I(box-basic) \
|
||||
focus $I(box-accent) \
|
||||
hover $I(box-hover) \
|
||||
] -border 5 -padding {8} -sticky news
|
||||
|
||||
ttk::style element create Spinbox.uparrow \
|
||||
image [list $I(up) \
|
||||
disabled $I(up) \
|
||||
pressed $I(up-accent) \
|
||||
active $I(up-accent) \
|
||||
] -border 4 -width 15 -sticky e
|
||||
|
||||
ttk::style element create Spinbox.downarrow \
|
||||
image [list $I(down) \
|
||||
disabled $I(down) \
|
||||
pressed $I(down-accent) \
|
||||
active $I(down-accent) \
|
||||
] -border 4 -width 15 -sticky e
|
||||
|
||||
ttk::style element create Spinbox.button \
|
||||
image [list $I(combo-button-basic) \
|
||||
{!readonly focus} $I(combo-button-focus) \
|
||||
{readonly focus} $I(combo-button-hover) \
|
||||
{readonly hover} $I(combo-button-hover)
|
||||
] -border 5 -padding {2 6 6 6}
|
||||
|
||||
# Sizegrip
|
||||
ttk::style element create Sizegrip.sizegrip image $I(size) \
|
||||
-sticky ewns
|
||||
|
||||
# Separator
|
||||
ttk::style element create Horizontal.separator image $I(separator)
|
||||
|
||||
ttk::style element create Vertical.separator image $I(separator)
|
||||
|
||||
# Card
|
||||
ttk::style element create Card.field image $I(card) \
|
||||
-border 10 -padding 4 -sticky news
|
||||
|
||||
# Labelframe
|
||||
ttk::style element create Labelframe.border image $I(card) \
|
||||
-border 5 -padding 4 -sticky news
|
||||
|
||||
# Notebook
|
||||
ttk::style element create Notebook.client \
|
||||
image $I(notebook) -border 5
|
||||
|
||||
ttk::style element create Notebook.tab \
|
||||
image [list $I(tab-disabled) \
|
||||
selected $I(tab-basic) \
|
||||
active $I(tab-hover) \
|
||||
] -border 5 -padding {14 4}
|
||||
|
||||
# Treeview
|
||||
ttk::style element create Treeview.field image $I(card) \
|
||||
-border 5
|
||||
|
||||
ttk::style element create Treeheading.cell \
|
||||
image [list $I(tree-basic) \
|
||||
pressed $I(tree-pressed)
|
||||
] -border 5 -padding 4 -sticky ewns
|
||||
|
||||
ttk::style element create Treeitem.indicator \
|
||||
image [list $I(right) \
|
||||
user2 $I(empty) \
|
||||
user1 $I(down) \
|
||||
] -width 26 -sticky {}
|
||||
|
||||
ttk::style configure Treeview -background $colors(-bg)
|
||||
ttk::style configure Treeview.Item -padding {2 0 0 0}
|
||||
ttk::style map Treeview \
|
||||
-background [list selected #ccc] \
|
||||
-foreground [list selected $colors(-fg)]
|
||||
|
||||
# Panedwindow
|
||||
# Insane hack to remove clam's ugly sash
|
||||
ttk::style configure Sash -gripcount 0
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 346 B |
|
After Width: | Height: | Size: 319 B |
|
After Width: | Height: | Size: 329 B |
|
After Width: | Height: | Size: 285 B |
|
After Width: | Height: | Size: 326 B |
|
After Width: | Height: | Size: 444 B |
|
After Width: | Height: | Size: 442 B |
|
After Width: | Height: | Size: 390 B |
|
After Width: | Height: | Size: 451 B |
|
After Width: | Height: | Size: 314 B |
|
After Width: | Height: | Size: 281 B |
|
After Width: | Height: | Size: 319 B |
|
After Width: | Height: | Size: 440 B |
|
After Width: | Height: | Size: 128 B |
|
After Width: | Height: | Size: 429 B |
|
After Width: | Height: | Size: 247 B |
|
After Width: | Height: | Size: 254 B |
|
After Width: | Height: | Size: 299 B |
|
After Width: | Height: | Size: 234 B |
|
After Width: | Height: | Size: 271 B |