Skip to content

Commit

Permalink
Set min opaqueness limit to 20, and fixed net tool type
Browse files Browse the repository at this point in the history
  • Loading branch information
capehill committed Aug 2, 2016
1 parent c447c87 commit 203e61b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CPU_Watcher.readme
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Features:

simple: use "simple" method to measure CPU load.

opaqueness: values between [10, 255] adjust window transparency.
opaqueness: values between [20, 255] adjust window transparency.

bgcol: window background color.

Expand Down
12 changes: 8 additions & 4 deletions cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ static __attribute__((used)) char *version_string = "$VER: CPU Watcher 0.6 (2.8.
#define UL_COL 0xFFFF1010 // Red
#define BG_COL 0xFF000000

#define MAX_OPAQUENESS 255
#define MIN_OPAQUENESS 20

extern struct Library *GfxBase;
struct TimerIFace *ITimer = NULL;

Expand Down Expand Up @@ -472,10 +475,10 @@ static void set_color(struct DiskObject *disk_object, STRPTR name, ULONG *value)

static UBYTE validate_opaqueness(int opaqueness)
{
if (opaqueness > 255) {
opaqueness = 255;
} else if (opaqueness < 10) {
opaqueness = 10;
if (opaqueness > MAX_OPAQUENESS) {
opaqueness = MAX_OPAQUENESS;
} else if (opaqueness < MIN_OPAQUENESS) {
opaqueness = MIN_OPAQUENESS;
}

return opaqueness;
Expand All @@ -497,6 +500,7 @@ static void read_config(Context *ctx, STRPTR file_name)
set_bool(disk_object, "gmem", &ctx->features.video_mem);
set_bool(disk_object, "solid", &ctx->features.solid_draw);
set_bool(disk_object, "dragbar", &ctx->features.dragbar);
set_bool(disk_object, "net", &ctx->features.net);
set_bool(disk_object, "simple", (BOOL *)&ctx->simple_mode);

set_int(disk_object, "xpos", &ctx->x_pos);
Expand Down

0 comments on commit 203e61b

Please sign in to comment.