Comments (10)
Test your code using standard controls, I'm pretty sure you will have the same issues, I've found that checking Auto Recalculate in the Window settings doesn't always work as expected. Do a manual recalculate. The reason I say try this with normal controls is because BGHUDAppKit doesn't do anything to the function of the controls, just the appearance, so please let me know if your test fails, that way I can figure out why behavior is being modified and not just appearance :)
But to answer your question in quick words, yes, BGHUDAppKit should maintain all functionality of the original apple counterparts.
from bghudappkit.
I've checked and the actual problem is that the controls do not draw a "focus ring". Ie. the controls are fully functional but do not show that they are selected.
So when the user tabs through the controls it looks like nothing is happening. Actually pressing the "space" key to activate the control activated the control; the key loop is fine.
I think all you need to do is to draw the focus ring around the button in in the drawRect method if it is the first responder.
The focus ring is only displayed if the "All Controls" radio button is selected in the "Full Keyboard Access" section of the "Keyboard Shortcuts" tab of the "Keyboard" System Preferences.
from bghudappkit.
I've had a look in the source code and it seems that the problem is simply that no focus ring is being set in the -(void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView method of the BGHUDButtonCell class. Just adding the call seems to produce ok-ish results:
-(void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
// Make sure our own height is right, and not using
// a NSMatrix parents height.
cellFrame.size.height = [self cellSize].height;
[NSGraphicsContext saveGraphicsState];
if([super showsFirstResponder] && [[[self controlView] window] isKeyWindow] &&
([self focusRingType] == NSFocusRingTypeDefault ||
[self focusRingType] == NSFocusRingTypeExterior)) {
[[[[BGThemeManager keyedManager] themeForKey: self.themeKey] focusRing] set];
}
switch ([self bezelStyle]) {
case NSTexturedRoundedBezelStyle:
[self drawTexturedRoundedButtonInFrame: cellFrame];
break;
case NSRoundRectBezelStyle:
[self drawRoundRectButtonInFrame: cellFrame];
break;
case NSSmallSquareBezelStyle:
[self drawSmallSquareButtonInFrame: cellFrame];
break;
case NSRoundedBezelStyle:
[self drawRoundedButtonInFrame: cellFrame];
break;
}
if([[_normalImage name] isEqualToString: @"NSSwitch"] ||
[[_normalImage name] isEqualToString: @"NSRadioButton"]) {
if([self imagePosition] != NSNoImage) {
[self drawImage: [self image] withFrame: cellFrame inView: [self controlView]];
}
}
[NSGraphicsContext restoreGraphicsState];
}
I haven't played around a lot with it yet but it certainly makes the focus visible even if it turns out that there is still room for a bit of fine tuning in the drawing.
I hope this helps.
from bghudappkit.
Sure does, I'm currently in the process of changing how BGHUDAppKit draws things, I tried to draw everything within it's own bounds, afterwards I found out that alot of the specular effects, focus rings, shadows and whatnot are actually drawn in the parent view.
from bghudappkit.
Based on my experiences with https://github.com/ugol/pomodoro/ BGHUDAppKit does not support keyboard shortcuts like cmd+c or cmd+v - see https://github.com/ugol/pomodoro/issues/issue/102
from bghudappkit.
Alexander,
Not sure why it doesn't on your end. Works fine on my end, I made no changes to any part of the function of the control, only the drawing.
See this vid as example:
http://www.binarymethod.com/Works.mov
from bghudappkit.
Interesting. This is my video: http://dl.dropbox.com/u/1358485/bugs/pomodoro/ScreenRecording.m4v
from bghudappkit.
Just a thought.. in the video you can't see the menu bar. The Command-C/ Command-V behavior relies on the items being defined in the Edit menu and connected to the first responder. You haven't deleted or "disabled" these items in any way?
from bghudappkit.
Do these screenshots help?
http://dl.dropbox.com/u/1358485/bugs/pomodoro/screenshot1.png
http://dl.dropbox.com/u/1358485/bugs/pomodoro/screenshot2.png
from bghudappkit.
Closed
from bghudappkit.
Related Issues (20)
- unable to resolve warnings 'directory not found' HOT 3
- How to work with XCode 4 HOT 25
- Can't load interface builder plugin HOT 2
- BGHUDTokenField - Text colour breaks after token deletion HOT 6
- Insertion Point Color
- xcode 4 compatibility HOT 5
- BGHudButtonCell Round Texture Small & Mini render issues HOT 4
- BGHudButtonCell check box renders invisible HOT 3
- NSButton - Small size stroke missing on bottom HOT 1
- Rejected from Mac App Store HOT 2
- Creating matrix/radio buttons, take 2 HOT 1
- Private API Use? HOT 1
- Vertical slider doesn't draw correctly in disabled state (patch included) HOT 1
- Should button outlines be drawn in the disabledStrokeColor in the disabled state? (patch included)
- Is it possible to draw the tick marks of a disabled BGSliderCell in the disabledStrokeColor? HOT 1
- BGHUDTokenField Visual Issues in OSX Lion HOT 4
- Access BGHUDAppKit programmatically HOT 2
- BGHUDScrollView scroll arrows "DoubleBoth" HOT 2
- Couldn't be initialized! Always is nil.
- Add these developers as collaborators to keep project from code rot. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bghudappkit.