- rename CircleGraphView to PieWidget

- add option to show/hide the value in PieWidget
- add option to fill full pie in PieWidget
This commit is contained in:
Serhiy Mytrovtsiy
2020-11-30 17:27:20 +01:00
parent 461328b52c
commit cb267ad89e
3 changed files with 25 additions and 9 deletions

View File

@@ -31,7 +31,7 @@ internal class Popup: NSView, Popup_p {
private var idleField: NSTextField? = nil
private var chart: LineChartView? = nil
private var circle: CircleGraphView? = nil
private var circle: PieChartView? = nil
private var temperatureCircle: HalfCircleGraphView? = nil
private var frequencyCircle: HalfCircleGraphView? = nil
private var initialized: Bool = false
@@ -118,7 +118,12 @@ internal class Popup: NSView, Popup_p {
let view: NSView = NSView(frame: NSRect(x: 0, y: 0, width: self.frame.width, height: self.dashboardHeight))
let container: NSView = NSView(frame: NSRect(x: 0, y: 10, width: view.frame.width, height: self.dashboardHeight-20))
self.circle = CircleGraphView(frame: NSRect(x: (container.frame.width - container.frame.height)/2, y: 0, width: container.frame.height, height: container.frame.height), segments: [])
self.circle = PieChartView(frame: NSRect(
x: (container.frame.width - container.frame.height)/2,
y: 0,
width: container.frame.height,
height: container.frame.height
), segments: [], drawValue: true)
self.circle!.toolTip = LocalizedString("CPU usage")
container.addSubview(self.circle!)

View File

@@ -34,7 +34,7 @@ internal class Popup: NSView, Popup_p {
private var compressedField: NSTextField? = nil
private var chart: LineChartView? = nil
private var circle: CircleGraphView? = nil
private var circle: PieChartView? = nil
private var level: PressureView? = nil
private var initialized: Bool = false
private var processesInitialized: Bool = false
@@ -117,7 +117,12 @@ internal class Popup: NSView, Popup_p {
let view: NSView = NSView(frame: NSRect(x: 0, y: self.frame.height - self.dashboardHeight, width: self.frame.width, height: self.dashboardHeight))
let container: NSView = NSView(frame: NSRect(x: 0, y: 10, width: view.frame.width, height: self.dashboardHeight-20))
self.circle = CircleGraphView(frame: NSRect(x: (container.frame.width - container.frame.height)/2, y: 0, width: container.frame.height, height: container.frame.height), segments: [])
self.circle = PieChartView(frame: NSRect(
x: (container.frame.width - container.frame.height)/2,
y: 0,
width: container.frame.height,
height: container.frame.height
), segments: [], drawValue: true)
self.circle!.toolTip = LocalizedString("Memory usage")
container.addSubview(self.circle!)